Real optimize websocket proxy
@@ -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
