]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Disable HTTP/2 strict header validation (#637)
authorTom Christie <tom@tomchristie.com>
Mon, 16 Dec 2019 12:19:25 +0000 (12:19 +0000)
committerGitHub <noreply@github.com>
Mon, 16 Dec 2019 12:19:25 +0000 (12:19 +0000)
httpx/dispatch/http2.py

index 43ea8df7a891c95058edae061c1eb82be2d9b9eb..24ed83dd901298697d36189d46a8c21a0c2c1fb1 100644 (file)
@@ -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]]