Fairing for internally normalizing request URIs#345
Open
jasonyess wants to merge 1 commit intostadust:masterfrom
Open
Fairing for internally normalizing request URIs#345jasonyess wants to merge 1 commit intostadust:masterfrom
jasonyess wants to merge 1 commit intostadust:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #345 +/- ##
==========================================
- Coverage 35.71% 35.55% -0.16%
==========================================
Files 121 122 +1
Lines 5886 5912 +26
==========================================
Hits 2102 2102
- Misses 3784 3810 +26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
116bb18 to
2086293
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adds a fairing which appends a trailing slash (if needed) to incoming requests, but only for route handlers whose URIs have a trailing slash (so if the route is
#[rocket::get("/foo")]the fairing won't do anything)this fairing will not add a trailing slash if the request is attempting to fetch static files, since it only modifies requests which are trying to reach one of our route handlers
this eliminates the need for some server config and also keeps behavior consistent between both variants, with and without a trailing slash
i found this useful for my local environment so i figured i'll open a pr 🙃 there are a handful of things that point to uris without the trailing slash so this fixes the nuisance
License Acceptance
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.