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

fix(supernode/httpclient): use HEAD request(not GET) to GetContentLength #1492

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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