From: Tom Christie Date: Mon, 16 Dec 2019 12:19:25 +0000 (+0000) Subject: Disable HTTP/2 strict header validation (#637) X-Git-Tag: 0.9.5~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0783baea3ea9efc9918ef3e21c75fe8867352ee3;p=thirdparty%2Fhttpx.git Disable HTTP/2 strict header validation (#637) --- diff --git a/httpx/dispatch/http2.py b/httpx/dispatch/http2.py index 43ea8df7..24ed83dd 100644 --- a/httpx/dispatch/http2.py +++ b/httpx/dispatch/http2.py @@ -2,6 +2,7 @@ import typing import h2.connection import h2.events +from h2.config import H2Configuration from h2.settings import SettingCodes, Settings from ..concurrency.base import ( @@ -21,6 +22,7 @@ logger = get_logger(__name__) class HTTP2Connection(OpenConnection): READ_NUM_BYTES = 4096 + CONFIG = H2Configuration(validate_inbound_headers=False) def __init__( self, @@ -31,7 +33,7 @@ class HTTP2Connection(OpenConnection): self.socket = socket self.backend = lookup_backend(backend) self.on_release = on_release - self.state = h2.connection.H2Connection() + self.state = h2.connection.H2Connection(config=self.CONFIG) self.streams = {} # type: typing.Dict[int, HTTP2Stream] self.events = {} # type: typing.Dict[int, typing.List[h2.events.Event]]