Skip to content

Properly preserve encoded slashes when using base_url - #1407

Merged
lovelydinosaur merged 1 commit into
masterfrom
fm/url-preserve-encoded-slashes
Dec 2, 2020
Merged

Properly preserve encoded slashes when using base_url#1407
lovelydinosaur merged 1 commit into
masterfrom
fm/url-preserve-encoded-slashes

Conversation

@florimondmanca

@florimondmancaflorimondmanca commented Dec 1, 2020

Copy link
Copy Markdown
Contributor

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 teamDecember 1, 2020 23:30
@florimondmancaflorimondmanca changed the title Properly encoded slashes when using base_urlProperly preserve encoded slashes when using base_urlDec 1, 2020
@lovelydinosaur

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

@lovelydinosaurlovelydinosaur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lovely & neat, yup!

@jbaayen

jbaayen commented Dec 2, 2020

Copy link
Copy Markdown

I can confirm that this PR does fix the concrete test of https://github.com/encode/httpx/issues/1405#issuecomment-737163659.

[ 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: tom@tomchristie.com
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

@lovelydinosaur
lovelydinosaur merged commit 9005bd5 into masterDec 2, 2020
@lovelydinosaur
lovelydinosaur deleted the fm/url-preserve-encoded-slashes branch December 2, 2020 13:01
@lovelydinosaur

Copy link
Copy Markdown
Member

👍 Thanks all!

@jbaayen

Copy link
Copy Markdown

Thank you!

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@florimondmanca@lovelydinosaur@jbaayen