twisted / treq

Python requests like API built on top of Twisted's HTTP client.
Other
587 stars 139 forks source link

Pass through bytes in path and querystring #304

Closed twm closed 3 years ago

twm commented 3 years ago

Per discussion on #303, arbitrary bytes in the path and query should pass through even if they aren't UTF-8 encoded. The params argument should also accept arbitrary bytes, rather than just ASCII.

The approach here is to use hyperlink.EncodedURL (a.k.a. hyperlink.URL) rather than DecodedURL. The latter has strong UTF-8 opinions. treq continues to accept either type (or bytes or str) as the url argument.

twm commented 3 years ago

Thank you very much for the review, @adiroiban! I'll merge and release shortly.