[MISC] Debug message shows used headers instead of fallback warning. (#772)

This enhancement clarifies the log message following discussions, closes #691.
pull/774/head
Clément Michaud 2020-03-22 23:12:24 +01:00 committed by GitHub
parent c75c61f94a
commit 2b4bb3bb05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

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