How to disable URL path normalization? #1805
-
BackgroundIn vulnerability scanning scenario we often need to use dot segments Test caseURL
ComparisonWith
With requests we can:
With aiohttp we can: https://stackoverflow.com/questions/61140190/python-force-aiohttp-to-not-normalize-url
How should we achieve the same effect with httpx? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
as note: aio-libs/aiohttp#4307 |
Beta Was this translation helpful? Give feedback.
-
Giving this another +1, was about to create a new issue/discussion but found this one just before posting the below. whatAdd an option to >>> import httpx
>>> httpx.URL('http://0.0.0.0.0/././b')
URL('http://0.0.0.0.0/b') >>> import yarl
>>> yarl.URL('http://0.0.0.0.0/././b')
URL('http://0.0.0.0.0/b')
>>> yarl.URL('http://0.0.0.0.0/././b', encoded=True)
URL('http://0.0.0.0.0/././b') whyI'm working on transitioning aiobotocore to httpx from aiohttp and hit a roadblock due to the above issue since:
I'm open to writing a PR that implements it, it feels like it should be a fairly straightforward implementation given that the normalization already is conditional: Lines 256 to 257 in 392dbe4 doing hacky things with unsupported APIs and strictly pinning requirements would not be great, given that this is a library and not an application. |
Beta Was this translation helpful? Give feedback.
Docs pull request... #3160