-
Notifications
You must be signed in to change notification settings - Fork 108
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
Port becomes optional #92
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor docstring note
@@ -51,7 +51,7 @@ class AsyncHTTPProxy(AsyncConnectionPool): | |||
|
|||
def __init__( | |||
self, | |||
proxy_origin: Origin, | |||
proxy_url: URL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG thanks! 😅
The docstring above needs to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I initially tackled this separately only to realize this PR already existed. :-) This implementation with the url_to_origin()
helper is even better than what I came up with.
|
||
def url_to_origin(url: URL) -> Origin: | ||
scheme, host, explicit_port = url[:3] | ||
default_port = {b'http': 80, b'https': 443}[scheme] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was curious why Black didn't cough up on this usage of single quotes, only to realize it's not run in scripts/check
.
It's been a while since I've been around here but I assume it (and the isort check) was removed on purpose from there?
Edit: OK, looks like we're planning to introduce black and flake8 back in #67
Tuple[bytes, bytes, int]
, since we need a canonical form there.proxy_origin
becomesproxy_url
for better consistency.HTTPX would need to update the
proxy_origin
form it uses toproxy_url
.