Repository navigation
Conversation
this requires new extensions inside httpcore
| extensions: typing.Dict[str, typing.Any] = { | ||
| "trace": functools.partial(trace, verbose=verbose) | ||
| } |
There was a problem hiding this comment.
Do we need to type annotate this?
If we do (because of our tooling) then does just extensions: dict also pass?
There was a problem hiding this comment.
yes, it was autolabelling with Partial[None] from "trace". just "dict" works. (pushed)
|
i am working on a test case for connect_to, but a test case for sni_hostname will be more involved, since we don't create a tls server inside the test suit currently (i think). |
I wouldn't worry about it. It'd be enough either to (The line itself is trivially simple, so... 🤷♂️) |
|
My workflow for testing stuff direct from branches these days is looking like this... $ python3.9 -m venv venv
# Install your `buddy_extensions` branch of httpcore
$ venv/bin/pip install git+https://github.com/toppk/httpcore.git@buddy_extensions
# Install your `buddy_extensions` branch of httpx, including the optional cli dependancies
$ venv/bin/pip install "httpx[cli] @ git+https://github.com/toppk/httpx.git@buddy_extensions"
# Everything's installed and working as expected...
$ venv/bin/httpx https://neverin.org/headers --x-connect-to 35.171.190.227 --x-sni-hostname www.httpbin.org
HTTP/1.1 200 OK
Date: Thu, 10 Feb 2022 17:19:05 GMT
Content-Type: application/json
Content-Length: 222
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Host": "neverin.org",
"User-Agent": "python-httpx/0.22.0",
"X-Amzn-Trace-Id": "Root=1-62054909-2b49d49373a4dc8b585dea22"
}
} |
okay. I haven't done a pip with git yet, but it seems very handy. my workflow is not as perfect. I generally avoid venvs because i like to live in a messy world. i think we're overdue to bump the revs on the test suite. in anycase I've added the test case for connect_to, and included sni_hostname in there for simplicity. |
|
this works on my 3.9, but not on my 3.6. investigating now... |
|
silly me, this will not work until a httpcore is released.. I consider this done pending that event. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
this requires new extensions inside httpcore (encode/httpcore#507)
Here is a snipped I used to test this.
python -c 'import httpx; import sys;httpx.main(sys.argv[1:])' https://neverin.org/headers --x-connect-to 54.221.78.73 --x-sni-hostname httpbin.org