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] Disable redirect slashes globally and remove trailing / from /query #328

Merged
merged 11 commits into from
Aug 2, 2024

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Jul 29, 2024

Changes proposed in this pull request:

  • API will no longer redirect requests with or without a trailing slash to the version defined in the route decorator
  • /query route no longer expects a slash at the end (or before query params)
  • Minor fix of a leftover test context issue: authentication is now explicitly enabled for tests of request authorization headers
  • uvicorn command in Dockerfile updated to trust X-Forwarded... proxy headers from all remote IPs, to ensure we don't lose https from a request once behind a proxy (this should happen less with the redirects now disabled, but this change should nonetheless act as a safeguard against different proxy server setups)

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

@alyssadai alyssadai changed the title Disable redirect slashes globally and remove trailing / from /query [MNT] Disable redirect slashes globally and remove trailing / from /query Jul 29, 2024
@alyssadai alyssadai changed the title [MNT] Disable redirect slashes globally and remove trailing / from /query [FIX] Disable redirect slashes globally and remove trailing / from /query Jul 29, 2024
@alyssadai alyssadai added the pr-minor-breaking Feature or enhancement that breaks compatibility, will increment minor version (0.+1.0) label Jul 29, 2024
@alyssadai alyssadai marked this pull request as ready for review July 29, 2024 15:49
@coveralls
Copy link
Collaborator

coveralls commented Jul 29, 2024

Pull Request Test Coverage Report for Build 10185692508

Details

  • 29 of 29 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 96.044%

Totals Coverage Status
Change from base Build 10149110427: 0.08%
Covered Lines: 704
Relevant Lines: 733

💛 - Coveralls

@alyssadai alyssadai requested a review from rmanaem July 29, 2024 16:32
Copy link
Collaborator

@rmanaem rmanaem left a comment

Choose a reason for hiding this comment

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

🧑‍🍳

@alyssadai alyssadai added the release Create a release when this PR is merged label Jul 29, 2024
@alyssadai alyssadai merged commit 9d99bd0 into main Aug 2, 2024
6 checks passed
@alyssadai alyssadai deleted the disable-redirect-slashes branch August 2, 2024 16:01
Copy link

neurobagel-bot bot commented Aug 2, 2024

🚀 PR was released in v0.3.0 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-minor-breaking Feature or enhancement that breaks compatibility, will increment minor version (0.+1.0) release Create a release when this PR is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Routes without trailing slash cause 307 redirect which breaks reverse proxies via paths
3 participants