From 04fb522ce79f8b11d1647ec3cff1b0eb591cc9c1 Mon Sep 17 00:00:00 2001 From: hoelee Date: Thu, 14 May 2026 09:58:00 +0800 Subject: [PATCH] feat(botfilter): add addressString --- botfilter.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/botfilter.go b/botfilter.go index 14f530da..655d7a3e 100644 --- a/botfilter.go +++ b/botfilter.go @@ -91,3 +91,10 @@ func (b *botFilter) reject(rw http.ResponseWriter, ip, reason string, decision c _, _ = io.WriteString(rw, "request denied\n") } +func addressString(addr netip.Addr) string { + if !addr.IsValid() { + return "" + } + return addr.String() +} +