Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): use of inconsistent methods for determining origin #2848

Merged
merged 6 commits into from Feb 6, 2022

Conversation

james-d-elliott
Copy link
Member

This unifies the methods to obtain the X-Forwarded-* header values and provides logical fallbacks. In addition, so we can ensure this functionality extends to the templated files we've converted the ServeTemplatedFile method into a function that operates as a middlewares.RequestHandler.

This unifies the methods to obtain the X-Forwarded-* header values and provides logical fallbacks. In addition, so we can ensure this functionality extends to the templated files we've converted the ServeTemplatedFile method into a function that operates as a middlewares.RequestHandler.
@authelia
Copy link

authelia bot commented Feb 5, 2022

Artifacts

These changes are published for testing on Buildkite, DockerHub and GitHub Container Registry.

Docker Container

  • docker pull authelia/authelia:fix-origin-processing
  • docker pull ghcr.io/authelia/authelia:fix-origin-processing

@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #2848 (648a7c9) into master (7775d2a) will decrease coverage by 0.12%.
The diff coverage is 80.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2848      +/-   ##
==========================================
- Coverage   63.89%   63.77%   -0.13%     
==========================================
  Files         217      217              
  Lines       10645    10660      +15     
  Branches      270      270              
==========================================
- Hits         6802     6798       -4     
- Misses       3349     3363      +14     
- Partials      494      499       +5     
Flag Coverage Δ
backend 67.48% <80.20%> (-0.16%) ⬇️
frontend 41.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/server/template.go 47.56% <37.50%> (ø)
internal/middlewares/authelia_context.go 69.66% <83.13%> (-0.74%) ⬇️
internal/middlewares/strip_path.go 100.00% <100.00%> (ø)
internal/server/server.go 82.09% <100.00%> (ø)
internal/handlers/handler_register_u2f_step1.go 15.62% <0.00%> (-12.50%) ⬇️
internal/ntp/ntp.go 51.06% <0.00%> (-10.64%) ⬇️
internal/handlers/handler_sign_u2f_step1.go 7.24% <0.00%> (-5.80%) ⬇️

Copy link
Member

@nightah nightah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small issue, otherwise LGTM.

internal/server/template.go Outdated Show resolved Hide resolved
@james-d-elliott james-d-elliott merged commit 26236f4 into master Feb 6, 2022
@james-d-elliott james-d-elliott deleted the fix-origin-processing branch February 6, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants