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 ASGITransport path escaping #1307

Merged
merged 1 commit into from Sep 23, 2020
Merged

Conversation

tomchristie
Copy link
Member

In the ASGI scope, the path key should be URL escaped...

path (Unicode string) – HTTP request target excluding any query string, with percent-encoded sequences and UTF-8 byte sequences decoded into characters.

Also, since 0.15.0 we're making sure to properly URL escape path components, so we're more likely to be bumping into this bug. Eg. in the test case included here we use...

url = httpx.URL("http://www.example.org/").copy_with(path="/user@example.org")

Which from 0.15.0 onwards will result in "http://www.example.org/user%40example.org", which will trigger the ASGI bug.

@tomchristie tomchristie added the bug Something isn't working label Sep 23, 2020
@tomchristie tomchristie merged commit e53f995 into master Sep 23, 2020
@tomchristie tomchristie deleted the fix-asgi-transport-path-escaping branch September 23, 2020 08:37
@tomchristie tomchristie mentioned this pull request Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants