Skip to content

Conversation

pquentin
Copy link
Member

Depends on #3202, relates #3196

It relies on sending requests that violate the HTTP spec, and that are
refused by h11 as used by Hypercorn, our new test server. Thankfully, we
don't need the return of the server, looking at what urllib3 would have
sent is enough.
@@ -890,7 +896,7 @@ def test_preserves_path_dot_segments(self) -> None:
"""ConnectionPool preserves dot segments in the URI"""
with HTTPConnectionPool(self.host, self.port) as pool:
response = pool.request("GET", "/echo_uri/seg0/../seg2")
assert response.data == b"/echo_uri/seg0/../seg2"
assert response.data == b"/echo_uri/seg0/../seg2?"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same issue than in #3193 where Flask/Quart insists on adding a question mark.

@@ -1061,6 +1019,8 @@ def test_headers_not_modified_by_request(
else:
conn = pool._get_conn()
conn.request("GET", "/headers", chunked=chunked)
conn.getresponse().close()
conn.close()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting ResourceWarnings without closing those properly. Possibly an advantage of using Trio.

@pquentin pquentin added the Skip Changelog Pull requests that don't require a changelog entry label Nov 22, 2023
Copy link
Member

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sethmlarson sethmlarson merged commit 8b4e568 into urllib3:main Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Pull requests that don't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants