From aacdbb940d825987689f1798e5fa999a844da517 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 16 Jun 2023 11:29:07 +0100 Subject: [PATCH] Add 'network_stream' extension to HTTP/2 connections (#729) --- httpcore/_async/http2.py | 1 + httpcore/_sync/http2.py | 1 + 2 files changed, 2 insertions(+) diff --git a/httpcore/_async/http2.py b/httpcore/_async/http2.py index 23701808..af7c5b8c 100644 --- a/httpcore/_async/http2.py +++ b/httpcore/_async/http2.py @@ -133,6 +133,7 @@ async def handle_async_request(self, request: Request) -> Response: content=HTTP2ConnectionByteStream(self, request, stream_id=stream_id), extensions={ "http_version": b"HTTP/2", + "network_stream": self._network_stream, "stream_id": stream_id, }, ) diff --git a/httpcore/_sync/http2.py b/httpcore/_sync/http2.py index 5cf43b29..2e5fe4a3 100644 --- a/httpcore/_sync/http2.py +++ b/httpcore/_sync/http2.py @@ -133,6 +133,7 @@ def handle_request(self, request: Request) -> Response: content=HTTP2ConnectionByteStream(self, request, stream_id=stream_id), extensions={ "http_version": b"HTTP/2", + "network_stream": self._network_stream, "stream_id": stream_id, }, )