diff --git a/api/ban.go b/api/ban.go index f158eab..bbacbb2 100644 --- a/api/ban.go +++ b/api/ban.go @@ -2,6 +2,7 @@ package api import ( "encoding/json" + "log" "net/http" "net/url" "strconv" @@ -50,6 +51,9 @@ func handleBanImpl(w http.ResponseWriter, r *http.Request) string { return "Missing pid in request" } + ipAddress := r.RemoteAddr + + log.Printf("Ban request: PID=%s, IP=%s", pidStr, ipAddress) pid, err := strconv.ParseUint(pidStr, 10, 32) if err != nil { return "Invalid pid" diff --git a/api/kick.go b/api/kick.go index 09e1c8b..403ef99 100644 --- a/api/kick.go +++ b/api/kick.go @@ -2,6 +2,7 @@ package api import ( "encoding/json" + "log" "net/http" "net/url" "strconv" @@ -48,6 +49,10 @@ func handleKickImpl(w http.ResponseWriter, r *http.Request) string { return "Missing pid in request" } + ipAddress := r.RemoteAddr + + log.Printf("Kick request: PID=%s, IP=%s", pidStr, ipAddress) + pid, err := strconv.ParseUint(pidStr, 10, 32) if err != nil { return "Invalid pid" diff --git a/api/unban.go b/api/unban.go index ad258f8..c003464 100644 --- a/api/unban.go +++ b/api/unban.go @@ -2,6 +2,7 @@ package api import ( "encoding/json" + "log" "net/http" "net/url" "strconv" @@ -48,6 +49,10 @@ func handleUnbanImpl(w http.ResponseWriter, r *http.Request) string { return "Missing pid in request" } + ipAddress := r.RemoteAddr + + log.Printf("Kick request: PID=%s, IP=%s", pidStr, ipAddress) + pid, err := strconv.ParseUint(pidStr, 10, 32) if err != nil { return "Invalid pid"