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

Commit

Permalink
fix(supernode/httpclient): use HEAD request(not GET) to GetContentLength
Browse files Browse the repository at this point in the history
  • Loading branch information
liangran10000 committed Sep 29, 2020
1 parent a928c0d commit 62a7ef2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion supernode/httpclient/origin_http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (client *OriginClient) RegisterTLSConfig(rawURL string, insecure bool, caBl
// GetContentLength sends a head request to get file length.
func (client *OriginClient) GetContentLength(url string, headers map[string]string) (int64, int, error) {
// send request
resp, err := client.HTTPWithHeaders(http.MethodGet, url, headers, 4*time.Second)
resp, err := client.HTTPWithHeaders(http.MethodHead, url, headers, 4*time.Second)
if err != nil {
return 0, 0, err
}
Expand Down

0 comments on commit 62a7ef2

Please sign in to comment.