From 8ae53cb9ae61f579e19ec7bb3fdfd7a6bb391bfb Mon Sep 17 00:00:00 2001 From: Mhammed Talhaouy Date: Thu, 19 Mar 2026 00:12:21 +0000 Subject: [PATCH 1/2] fix: prevent nil panic for unsafe HEAD requests --- common/httpx/httpx.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/httpx/httpx.go b/common/httpx/httpx.go index 039f4c4c..23744fb2 100644 --- a/common/httpx/httpx.go +++ b/common/httpx/httpx.go @@ -224,11 +224,11 @@ get_response: } var shouldIgnoreErrors, shouldIgnoreBodyErrors bool - switch { - case h.Options.Unsafe && req.Method == http.MethodHead && !stringsutil.ContainsAny(err.Error(), "i/o timeout"): + if h.Options.Unsafe && req.Method == http.MethodHead && err != nil && + !stringsutil.ContainsAny(err.Error(), "i/o timeout") { shouldIgnoreErrors = true shouldIgnoreBodyErrors = true - } + } var resp Response resp.Input = req.Host From 6425eb5ed0ec2792c8bd087fef0220d4db05b4f9 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Sat, 21 Mar 2026 00:01:56 +0100 Subject: [PATCH 2/2] fmt --- common/httpx/httpx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/httpx/httpx.go b/common/httpx/httpx.go index 23744fb2..e00e26dc 100644 --- a/common/httpx/httpx.go +++ b/common/httpx/httpx.go @@ -228,7 +228,7 @@ get_response: !stringsutil.ContainsAny(err.Error(), "i/o timeout") { shouldIgnoreErrors = true shouldIgnoreBodyErrors = true - } + } var resp Response resp.Input = req.Host