-
-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that ASGI 'raw_path' does not include query component of URL. (#…
- Loading branch information
1 parent
f8981f3
commit 90538a3
Showing
3 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,19 @@ async def test_asgi_raw_path(): | |
assert response.json() == {"raw_path": "/[email protected]"} | ||
|
||
|
||
@pytest.mark.anyio | ||
async def test_asgi_raw_path_should_not_include_querystring_portion(): | ||
""" | ||
See https://github.com/encode/httpx/issues/2810 | ||
""" | ||
async with httpx.AsyncClient(app=echo_raw_path) as client: | ||
url = httpx.URL("http://www.example.org/path?query") | ||
response = await client.get(url) | ||
|
||
assert response.status_code == 200 | ||
assert response.json() == {"raw_path": "/path"} | ||
|
||
|
||
@pytest.mark.anyio | ||
async def test_asgi_upload(): | ||
async with httpx.AsyncClient(app=echo_body) as client: | ||
|