fix block asn superfluous write header calls by returning after errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user