From 93f4c5e207ef6b93374a6e404d244c91a14c8ca6 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 28 Oct 2019 17:57:03 +0100 Subject: [PATCH] Real optimize websocket proxy (#1351) --- hassio/api/ingress.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hassio/api/ingress.py b/hassio/api/ingress.py index 839f0bc53..a0fe3a480 100644 --- a/hassio/api/ingress.py +++ b/hassio/api/ingress.py @@ -204,7 +204,15 @@ def _init_header( # filter flags for name, value in request.headers.items(): - if name in (hdrs.CONTENT_LENGTH, hdrs.CONTENT_ENCODING, istr(HEADER_TOKEN)): + if name in ( + hdrs.CONTENT_LENGTH, + hdrs.CONTENT_ENCODING, + hdrs.SEC_WEBSOCKET_EXTENSIONS, + hdrs.SEC_WEBSOCKET_PROTOCOL, + hdrs.SEC_WEBSOCKET_VERSION, + hdrs.SEC_WEBSOCKET_KEY, + istr(HEADER_TOKEN), + ): continue headers[name] = value @@ -226,10 +234,6 @@ def _response_header(response: aiohttp.ClientResponse) -> Dict[str, str]: hdrs.CONTENT_LENGTH, hdrs.CONTENT_TYPE, hdrs.CONTENT_ENCODING, - hdrs.SEC_WEBSOCKET_EXTENSIONS, - hdrs.SEC_WEBSOCKET_PROTOCOL, - hdrs.SEC_WEBSOCKET_VERSION, - hdrs.SEC_WEBSOCKET_KEY, ): continue headers[name] = value