From f51d2cc47147786284eed932276bb53e9eccc24a Mon Sep 17 00:00:00 2001 From: Domenico Testa Date: Wed, 6 May 2026 01:36:44 +0200 Subject: [PATCH] feat: logging unauthenticated requests --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index be0d755..b1ffd5b 100644 --- a/main.go +++ b/main.go @@ -34,6 +34,7 @@ func main() { u, p, ok := r.BasicAuth() if !ok || subtle.ConstantTimeCompare([]byte(u), []byte(username)) != 1 || subtle.ConstantTimeCompare([]byte(p), []byte(password)) != 1 { + log.Printf("unauthorized request from %s", r.RemoteAddr) w.Header().Set("WWW-Authenticate", `Basic realm="pz8-relay"`) http.Error(w, "unauthorized", http.StatusUnauthorized) return