From ec94bce2aafbae32561a2c5543a5f26391a037a7 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Wed, 20 Sep 2023 00:31:13 +0300 Subject: [PATCH] feat: log X-Real-IP --- auth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/auth.go b/auth.go index 5b7c8a4..a88dc93 100644 --- a/auth.go +++ b/auth.go @@ -12,8 +12,9 @@ type AuthHandler struct { func (l *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { AuthHeader := r.Header.Get("Authorization") + RealIP := r.Header.Get("X-Real-IP") if AuthHeader != task.Auth { - log.Printf("Dropping request from %s.", r.RemoteAddr) + log.Printf("Dropping request from %s.", RealIP) return // drop } l.Handler.ServeHTTP(w, r)