Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit 62a7ef2

Browse files
committed
fix(supernode/httpclient): use HEAD request(not GET) to GetContentLength
1 parent a928c0d commit 62a7ef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

supernode/httpclient/origin_http_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (client *OriginClient) RegisterTLSConfig(rawURL string, insecure bool, caBl
121121
// GetContentLength sends a head request to get file length.
122122
func (client *OriginClient) GetContentLength(url string, headers map[string]string) (int64, int, error) {
123123
// send request
124-
resp, err := client.HTTPWithHeaders(http.MethodGet, url, headers, 4*time.Second)
124+
resp, err := client.HTTPWithHeaders(http.MethodHead, url, headers, 4*time.Second)
125125
if err != nil {
126126
return 0, 0, err
127127
}

0 commit comments

Comments
 (0)