From 2b4bb3bb0574b749755f7c36ab4d76073ecf6e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Michaud?= Date: Sun, 22 Mar 2020 23:12:24 +0100 Subject: [PATCH] [MISC] Debug message shows used headers instead of fallback warning. (#772) This enhancement clarifies the log message following discussions, closes #691. --- internal/handlers/handler_verify.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/handlers/handler_verify.go b/internal/handlers/handler_verify.go index ee660b77..4b152420 100644 --- a/internal/handlers/handler_verify.go +++ b/internal/handlers/handler_verify.go @@ -34,10 +34,8 @@ func getOriginalURL(ctx *middlewares.AutheliaCtx) (*url.URL, error) { if err != nil { return nil, fmt.Errorf("Unable to parse URL extracted from X-Original-URL header: %v", err) } + ctx.Logger.Debug("Using X-Original-URL header content as targeted site URL") return url, nil - } else { - ctx.Logger.Debug("No X-Original-URL header detected, fallback to combination of " + - "X-Fowarded-Proto, X-Forwarded-Host and X-Forwarded-URI headers") } forwardedProto := ctx.XForwardedProto() @@ -61,6 +59,8 @@ func getOriginalURL(ctx *middlewares.AutheliaCtx) (*url.URL, error) { if err != nil { return nil, fmt.Errorf("Unable to parse URL %s: %v", requestURI, err) } + ctx.Logger.Debugf("Using X-Fowarded-Proto, X-Forwarded-Host and X-Forwarded-URI headers " + + "to construct targeted site URL") return url, nil }