1
0
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:
Romain 2022-08-11 16:20:14 +02:00 committed by GitHub
parent 40db06204b
commit 63f9ec9c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
} }