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

Client superfluously adding a trailing forward slash when provided with an empty path #2673

Closed
Mardoxx opened this issue Apr 19, 2023 · 1 comment

Comments

@Mardoxx
Copy link

Mardoxx commented Apr 19, 2023

https://www.rfc-editor.org/rfc/rfc3986#section-3
and
https://www.rfc-editor.org/rfc/rfc3986#section-3.3

Are http://base and http://base/ two distinct URLs? If so, so why does this is behaviour exist?

>>> from httpx import Client
>>> Client().build_request("GET",  "")
<Request('GET', '/')>
>>> Client().build_request("GET",  "/")
<Request('GET', '/')>
>>> 
@Mardoxx Mardoxx changed the title Client superfolously adding a trailing forward slash Client superfluously adding a trailing forward slash when provided with an empty path Apr 19, 2023
@tomchristie
Copy link
Member

See the HTTP/1.1 spec, RFC 2616...

Note that the absolute path cannot be empty; if none is present in the original URI, it MUST be given as "/"

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

No branches or pull requests

2 participants