mirror of
https://github.com/containous/traefik.git
synced 2024-12-22 13:34:03 +03:00
Remove request dump from IPWhitelist debug log and tracing message
This commit is contained in:
parent
40db06204b
commit
63f9ec9c38
@ -63,15 +63,16 @@ func (wl *ipWhiteLister) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
|||||||
ctx := middlewares.GetLoggerCtx(req.Context(), wl.name, typeName)
|
ctx := middlewares.GetLoggerCtx(req.Context(), wl.name, typeName)
|
||||||
logger := log.FromContext(ctx)
|
logger := log.FromContext(ctx)
|
||||||
|
|
||||||
err := wl.whiteLister.IsAuthorized(wl.strategy.GetIP(req))
|
clientIP := wl.strategy.GetIP(req)
|
||||||
|
err := wl.whiteLister.IsAuthorized(clientIP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logMessage := fmt.Sprintf("rejecting request %+v: %v", req, err)
|
msg := fmt.Sprintf("Rejecting IP %s: %v", clientIP, err)
|
||||||
logger.Debug(logMessage)
|
logger.Debug(msg)
|
||||||
tracing.SetErrorWithEvent(req, logMessage)
|
tracing.SetErrorWithEvent(req, msg)
|
||||||
reject(ctx, rw)
|
reject(ctx, rw)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
logger.Debugf("Accept %s: %+v", wl.strategy.GetIP(req), req)
|
logger.Debugf("Accepting IP %s", clientIP)
|
||||||
|
|
||||||
wl.next.ServeHTTP(rw, req)
|
wl.next.ServeHTTP(rw, req)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user