From 94a9fe0eb21cc5e48b2d161bbc005d669eeda109 Mon Sep 17 00:00:00 2001 From: hoelee Date: Wed, 28 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)) != "" +}