feat: log X-Real-IP
This commit is contained in:
parent
056a4a963c
commit
ec94bce2aa
3
auth.go
3
auth.go
@ -12,8 +12,9 @@ type AuthHandler struct {
|
|||||||
func (l *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (l *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
AuthHeader := r.Header.Get("Authorization")
|
AuthHeader := r.Header.Get("Authorization")
|
||||||
|
RealIP := r.Header.Get("X-Real-IP")
|
||||||
if AuthHeader != task.Auth {
|
if AuthHeader != task.Auth {
|
||||||
log.Printf("Dropping request from %s.", r.RemoteAddr)
|
log.Printf("Dropping request from %s.", RealIP)
|
||||||
return // drop
|
return // drop
|
||||||
}
|
}
|
||||||
l.Handler.ServeHTTP(w, r)
|
l.Handler.ServeHTTP(w, r)
|
||||||
|
Loading…
Reference in New Issue
Block a user