From e503e55ab51ac44dbaf545cfe035f8f0a7a352dc Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Thu, 8 Feb 2024 16:49:24 +0100 Subject: [PATCH] Use a HEAD instead of GET ... to retrieve only the headers of the resource without the body. This will save bandwidth and time. Signed-off-by: Volker Theile --- pkg/sync/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sync/handler.go b/pkg/sync/handler.go index e558f3fd..9edb88d7 100644 --- a/pkg/sync/handler.go +++ b/pkg/sync/handler.go @@ -34,7 +34,7 @@ func (h *HTTPHandler) GetSizeFromURL(url string) (size int64, err error) { ctx, cancel := context.WithTimeout(context.Background(), types.HTTPTimeout) defer cancel() - rr, err := http.NewRequestWithContext(ctx, "GET", url, nil) + rr, err := http.NewRequestWithContext(ctx, http.MethodHead, url, nil) if err != nil { return 0, err }