update
All checks were successful
release-tag / release-image (push) Successful in 2m16s

This commit is contained in:
2025-11-08 20:41:59 +01:00
parent a2d099aef5
commit 2901f7ad45

View File

@@ -268,12 +268,13 @@ func authHandler(st *state) http.Handler {
return return
} }
if decide(st, ip) { if decide(st, ip) {
// optional: reflect info for debugging log.Printf("Allowed: %s", ip)
w.Header().Set("X-IPFilter-Client", ip.String()) w.Header().Set("X-IPFilter-Client", ip.String())
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte("OK")) _, _ = w.Write([]byte("OK"))
return return
} }
log.Printf("Blocked: %s", ip)
w.Header().Set("X-IPFilter-Client", ip.String()) w.Header().Set("X-IPFilter-Client", ip.String())
http.Error(w, "forbidden by ip filter", http.StatusForbidden) http.Error(w, "forbidden by ip filter", http.StatusForbidden)
}) })