From 8f77d87a540f098cdba41d1a46b803e08e212690 Mon Sep 17 00:00:00 2001 From: hoelee Date: Tue, 12 May 2026 11:12:00 +0800 Subject: [PATCH] feat(botfilter): matcher.go part 3/5 --- matcher.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/matcher.go b/matcher.go index 7168a6a2..cc205fd8 100644 --- a/matcher.go +++ b/matcher.go @@ -103,3 +103,10 @@ func implausibleBrowser(r *http.Request, userAgent string) bool { return false } + // Do not require optional browser client-hint or fetch-metadata headers: + // older browsers and privacy tools legitimately omit them. Instead reject + // internally inconsistent browser family declarations. + isChromium := strings.Contains(ua, "chrome/") || strings.Contains(ua, "crios/") || strings.Contains(ua, "edg/") || strings.Contains(ua, "opr/") + isFirefox := strings.Contains(ua, "firefox/") + isSafari := strings.Contains(ua, "safari/") && !isChromium +