From e332a3351ab1c82dc18b62e3c251447a7020a280 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 31 May 2025 00:38:03 +0700 Subject: all: use HTTP method HEAD to check for image link Using HEAD does not return the content of image, which consume less resources on both end. --- worker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worker.go b/worker.go index f2be07f..99bef6f 100644 --- a/worker.go +++ b/worker.go @@ -129,7 +129,11 @@ func (wrk *worker) scan(linkq linkQueue) { httpResp *http.Response err error ) - httpResp, err = http.Get(linkq.url) + if linkq.kind == atom.Img { + httpResp, err = http.Head(linkq.url) + } else { + httpResp, err = http.Get(linkq.url) + } if err != nil { if linkq.parentUrl == nil { wrk.errq <- err -- cgit v1.3