Repository navigation
Use latin-1 for WSGI environ path and headers - #1321
Open
patrick-immometrica wants to merge 2 commits into
Open
patrick-immometrica wants to merge 2 commits into
patrick-immometrica wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Merging this PR will not alter performance
Comparing Footnotes
|
This branch has not been deployed
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.
Summary
PEP 3333 wants environ strings to hold the raw bytes decoded as latin-1.
WSGITransportpassed the decoded unicode path asPATH_INFO, and usedasciifor header values. With a Flask/werkzeug app:GET /caf%C3%A9-> the app sees/caf�GET /euro/%E2%82%AC->UnicodeEncodeErrorinside werkzeugUnicodeDecodeError/UnicodeEncodeErrorPATH_INFOis now built from the raw path bytes (unquote_to_bytesonraw_path) and decoded as latin-1, and header values use latin-1 both ways. encode/httpx#1391 fixed the unquoting for this, but not the encoding, so the example in encode/httpx#1365 still failed.Checklist