-
-
Notifications
You must be signed in to change notification settings - Fork 839
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
On proxies={"http": ...}
vs. proxies={"http://": ...}
#1105
Labels
user-experience
Ensuring that users have a good experience using the library
Milestone
Comments
tomchristie
added
the
user-experience
Ensuring that users have a good experience using the library
label
Jul 31, 2020
This was referenced Aug 2, 2020
Merged
Hello @tomchristie , Are you talking about the changes in UPD: @tomchristie I've created a PR just to show my idea. If I'm wrong, feel free to discard it |
cdeler
added a commit
to cdeler/httpx
that referenced
this issue
Aug 4, 2020
… of http://, https://, all://
cdeler
added a commit
to cdeler/httpx
that referenced
this issue
Aug 4, 2020
… of http://, https://, all://
cdeler
added a commit
to cdeler/httpx
that referenced
this issue
Aug 4, 2020
… of http://, https://, all://
cdeler
added a commit
to cdeler/httpx
that referenced
this issue
Aug 4, 2020
cdeler
added a commit
to cdeler/httpx
that referenced
this issue
Aug 5, 2020
…use proxies={"http": ...} instead of proxies={"http://": ...}
cdeler
added a commit
to cdeler/httpx
that referenced
this issue
Aug 5, 2020
…ies={"http": ...} instead of {"http://": ...}. Updated docs and added unit, which check the warning presence
cdeler
added a commit
to cdeler/httpx
that referenced
this issue
Aug 5, 2020
…ies={"http": ...} instead of {"http://": ...}. Updated docs and added unit, which check the warning presence
tomchristie
added a commit
that referenced
this issue
Aug 5, 2020
* #1105 added deprecation warning, raised when we try to use proxies={"http": ...} instead of {"http://": ...}. Updated docs and added unit, which check the warning presence * Update tests/client/test_proxies.py Co-authored-by: Florimond Manca <florimond.manca@gmail.com> * Update tests/client/test_proxies.py Co-authored-by: Tom Christie <tom@tomchristie.com> Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently we're in line with
requests
in supporting "all", "http", and "https" as valid proxy keys.Internally we handle those as URL patterns that we can match against, and eg.
"http"
is actually mapped to"http://"
.I'm wondering if we might have better internal consistency by...
My feeling is that doing so would create a nicer consistency, and also has a subtle indication to developers about what is actually going on here.
For example...
proxies={"http://": httpx.Proxies(...)}
neatly implies thatproxies={"http://www.example.com": httpx.Proxies(...)}
might also be a valid thing to do, which indeed it is.Allowing
proxies={"http": httpx.Proxies(...)}
makes it less obvious that the key is a general purpose URL pattern.Additionally this change means that other usages will end up with more expected behaviors, eg.- Not true, that'd parse as scheme='', host='', path='www.example.com'. Instead we'd probably want to be strict and ensure that only absolute URLs are allowed as pattern keys. (While still including a graceful deprecation for plain "http", "https", "all")proxies={"www.example.com": ...}
will do what you'd expect, rather than mapping toproxies={"www.example.com://": ...}
which is what we currently do.This becomes doubly relevant once we introduce a mount API, which will use the same URL pattern style for it's API, as current
proxies=...
argument.The text was updated successfully, but these errors were encountered: