Disabled unnecessary and expensive headers validation and normalization

This commit is contained in:
Vladimir Magamedov 2019-11-18 13:14:35 +02:00
parent 0940471928
commit d2ff0029ab
2 changed files with 12 additions and 2 deletions

View File

@ -587,8 +587,14 @@ class Channel:
self._codec = codec
self._status_details_codec = status_details_codec
self._config = H2Configuration(client_side=True,
header_encoding='ascii')
self._config = H2Configuration(
client_side=True,
header_encoding='ascii',
validate_inbound_headers=False,
validate_outbound_headers=False,
normalize_inbound_headers=False,
normalize_outbound_headers=False,
)
self._authority = '{}:{}'.format(self._host, self._port)
if ssl is True:

View File

@ -582,6 +582,10 @@ class Server(_GC, asyncio.AbstractServer):
self._config = h2.config.H2Configuration(
client_side=False,
header_encoding='ascii',
validate_inbound_headers=False,
validate_outbound_headers=False,
normalize_inbound_headers=False,
normalize_outbound_headers=False,
)
self._server: Optional[asyncio.AbstractServer] = None