fix block asn superfluous write header calls by returning after errors

This commit is contained in:
2026-11-23 09:00:34 -05:00
parent 993b6317a5
commit 0dc689d1a6
+2
View File
@@ -31,11 +31,13 @@ func (b *ASNBlocker) BlockASN(next http.Handler) http.Handler {
parsed, err := netip.ParseAddr(ip)
if err != nil {
b.Pages.HTTPError(w, r, "couldn't idenitify client address", http.StatusInternalServerError)
return
}
result := b.DB.Lookup(parsed)
if !result.Found() {
next.ServeHTTP(w, r)
return
}
var record ASNRecord