From 8212714c27946d85613c0b40240099fa7662de05 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Tue, 29 Sep 2020 15:48:30 +0800 Subject: [PATCH] fix(supernode/httpclient): use HEAD request(not GET) to GetContentLength Signed-off-by: Ryan Liang --- supernode/httpclient/origin_http_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supernode/httpclient/origin_http_client.go b/supernode/httpclient/origin_http_client.go index 5f6ee4a11..055194b07 100644 --- a/supernode/httpclient/origin_http_client.go +++ b/supernode/httpclient/origin_http_client.go @@ -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 }