Skip to content

Commit

Permalink
Make remoteHTTPProxyCache.Contains do HEAD request
Browse files Browse the repository at this point in the history
As only headers and response status are important and body is ignored
doing http HEAD will save some network.

Signed-off-by: Anton Tiurin <atiurin@proton.me>
  • Loading branch information
noxiouz authored and mostynb committed Apr 18, 2022
1 parent 73c9521 commit f774f6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache/httpproxy/httpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (r *remoteHTTPProxyCache) Contains(ctx context.Context, kind cache.EntryKin

url := r.requestURL(hash, kind)

req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
req, err := http.NewRequestWithContext(ctx, http.MethodHead, url, nil)
if err != nil {
return false, -1
}
Expand Down

0 comments on commit f774f6d

Please sign in to comment.