Uh oh!
There was an error while loading. Please reload this page.
URL.path: don't unquote slashes as this corrupts the path - #1406
Conversation
jessekv
commented
Dec 2, 2020
I think this change is ugly, and #1407 solves #1405 much better, so I am closing it. However, I still am concerned that if URL.path was accidentally used for constructing paths within httpx itself, wouldn't users be likely to make the mistake also? |
lovelydinosaur
commented
Dec 2, 2020
We're very careful and deliberate around our
|
This PR addresses issue https://github.com/encode/httpx/issues/1405
Using
unquotein a blanket way on the path can result in corrupting the path if the path contains encoded slashes. This change has some precedent in https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote, where the default behaviour is to treat the slash as a special case.Personally, I am not sure URL.path should be doing
unquoteat all. My preference would be to drop theunquotebehaviour entirely. Nevertheless, with this PR at leastURL.pathdoes not corrupt paths.I'd be happy to write some tests if this approach is approved.