Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly preserve encoded slashes when using base_url #1407

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

florimondmanca
Copy link
Member

@florimondmanca florimondmanca commented Dec 1, 2020

Update: Prompted by #1405

An alternative to #1406 that tweaks URL merging to operate on .raw_path, rather than .path. Rationale: .path is URL-decoded and might swallow pre-existing %2F characters into /. On the other hand .raw_path doesn't do URL-decoding, so it is suitable for handling encoded slashes as well.

@florimondmanca florimondmanca requested a review from a team December 1, 2020 23:30
@florimondmanca florimondmanca changed the title Properly encoded slashes when using base_url Properly preserve encoded slashes when using base_url Dec 1, 2020
@tomchristie
Copy link
Member

Great, yup this is a reasonable change.

I'm going to scrub the "Closes 1405" notation in the description, since the OP there doesn't note any usage of base_url, so although it's been a useful prompt onto this, which is a nice little tweak, I don't think it's relevant to what they're seeing.

@florimondmanca
Copy link
Member Author

@tomchristie Makes sense! Are we ✅ on this one?

Copy link
Member

@tomchristie tomchristie left a comment

Choose a reason for hiding this comment

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

Lovely & neat, yup!

@jbaayen
Copy link

jbaayen commented Dec 2, 2020

I can confirm that this PR does fix the concrete test of #1405 (comment).

[ Apologies for previous confusion in this comment, I had ended up with parallel installations of 0.15.0 and this branch. ]

12:33 $ pip show httpx
Name: httpx
Version: 0.16.1
Summary: The next generation HTTP client.
Home-page: https://github.com/encode/httpx
Author: Tom Christie
Author-email: [email protected]
License: BSD
Location: /home/jbaayen/httpx
Requires: certifi, sniffio, rfc3986, httpcore
Required-by: kisters.water.time-series, kisters.water.time-series.tsa, kisters.water.operational.access-control
✔ ~

image

@tomchristie tomchristie merged commit 9005bd5 into master Dec 2, 2020
@tomchristie tomchristie deleted the fm/url-preserve-encoded-slashes branch December 2, 2020 13:01
@tomchristie
Copy link
Member

👍 Thanks all!

@jbaayen
Copy link

jbaayen commented Dec 2, 2020

Thank you!

Do you know yet when a new release might be made?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants