From 1a5f1062df8c1764a6bcb18f46efb907fc6813e3 Mon Sep 17 00:00:00 2001 From: hoelee Date: Thu, 15 Jan 2026 16:30:00 +0800 Subject: [PATCH] feat(botfilter): add hasHeader --- util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util.go b/util.go index 69967412..7a80ec94 100644 --- a/util.go +++ b/util.go @@ -122,3 +122,6 @@ func pathMatches(path, rule string) bool { return path == rule || strings.HasPrefix(path, rule+"/") } +func hasHeader(r *http.Request, name string) bool { + return strings.TrimSpace(r.Header.Get(name)) != "" +}