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): respond with 404/405 appropriately #3087

Merged
merged 10 commits into from
Apr 3, 2022
Merged

Conversation

james-d-elliott
Copy link
Member

This adjusts the not found handler to not respond with a 404 on not found endpoints that are part of the /api or /.well-known folders, and respond with a 405 when the method isn't implemented.

Extracted from #3005

This adjusts the not found handler to not respond with a 404 on not found endpoints that are part of the /api or /.well-known folders, and respond with a 405 when the method isn't implemented.
@authelia
Copy link

authelia bot commented Apr 1, 2022

Artifacts

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

Docker Container

  • docker pull authelia/authelia:fix-api-404
  • docker pull ghcr.io/authelia/authelia:fix-api-404

@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #3087 (2f39a76) into master (fa143ea) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3087      +/-   ##
==========================================
+ Coverage   63.08%   63.14%   +0.06%     
==========================================
  Files         234      235       +1     
  Lines       12271    12291      +20     
  Branches      381      381              
==========================================
+ Hits         7741     7761      +20     
  Misses       4010     4010              
  Partials      520      520              
Flag Coverage Δ
backend 67.72% <100.00%> (+0.06%) ⬆️
frontend 37.89% <ø> (ø)

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

Impacted Files Coverage Δ
internal/handlers/response.go 63.26% <100.00%> (+0.76%) ⬆️
internal/server/handler_notfound.go 100.00% <100.00%> (ø)
internal/server/server.go 83.13% <100.00%> (+0.60%) ⬆️

@james-d-elliott james-d-elliott added status/needs-review Pull requests that need to be reviewed priority/4/normal Normal priority items labels Apr 1, 2022
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.

LGTM.

@james-d-elliott james-d-elliott merged commit 2502d89 into master Apr 3, 2022
@james-d-elliott james-d-elliott deleted the fix-api-404 branch April 3, 2022 23:58
@james-d-elliott james-d-elliott removed the status/needs-review Pull requests that need to be reviewed label Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/4/normal Normal priority items
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants