-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
WIP: Change normalize_path_middleware redirect from 301 -> 308 #3579
Conversation
Regarding unit tests, I can imagine a couple potential paths:
Let me know what you think! I'll leave this as a WIP until I have a path forward for testing. |
Bump CI |
Codecov Report
@@ Coverage Diff @@
## master #3579 +/- ##
==========================================
+ Coverage 97.9% 97.93% +0.02%
==========================================
Files 43 43
Lines 8560 8569 +9
Branches 1378 1375 -3
==========================================
+ Hits 8381 8392 +11
Misses 74 74
+ Partials 105 103 -2
Continue to review full report at Codecov.
|
Thanks! |
(cherry picked from commit b80fec6) Co-authored-by: Daniel Grossmann-Kavanagh <[email protected]>
…. (#3835) (cherry picked from commit b80fec6) Co-authored-by: Daniel Grossmann-Kavanagh <[email protected]>
Redirect path normalization with
308
Permanent Redirect
rather than301
Moved Permanently
.The default redirect class is currently HTTPMovedPermanently, which works for GET and HEAD requests, but does not work well for other HTTP methods. Clients will typically handle a
301
response by changing the verb to GET on redirect.Related RFCs:
Related aiohttp client behavior:
#3082 - clients being redirected POST -> GET (closed as wontfix)
#2134 - aiohttp client implementation of
308
Permanent Redirect
Are there changes in behavior for the user?
Users will no longer lose POST data during a redirect caused by a missing trailing slash.
Related issue number
#3578
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.