-
Notifications
You must be signed in to change notification settings - Fork 157
Add "network_stream" extension to HTTP/2. #724
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Currently the "network_stream" response extension is only exposed on HTTP/1.1 connections...
>>> import httpcore
>>> with httpcore.ConnectionPool() as http:
... r = http.request("GET", "https://www.example.com")
... print(r.extensions["network_stream"].get_extra_info("server_addr"))
...
('93.184.216.34', 443)...and is not exposed on HTTP/2 connections...
>>> import httpcore
>>> with httpcore.ConnectionPool(http2=True) as http:
... r = http.request("GET", "https://www.example.com")
... print(r.extensions["network_stream"].get_extra_info("server_addr"))
...
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
KeyError: 'network_stream'We should resolve this.
Relevant sections of the code are here...
httpcore/httpcore/_async/http2.py
Lines 134 to 137 in eb5957d
| extensions={ | |
| "http_version": b"HTTP/2", | |
| "stream_id": stream_id, | |
| }, |
httpcore/httpcore/_sync/http2.py
Lines 134 to 137 in eb5957d
| extensions={ | |
| "http_version": b"HTTP/2", | |
| "stream_id": stream_id, | |
| }, |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request