From 4771975e3bd64e121e2d90cc34d3de64e7ed6723 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Wed, 17 Apr 2024 07:30:25 -0700 Subject: [PATCH] aiohttp_ws: convert Sec-WebSocket-Key from bytes to str --- python-ecosys/aiohttp/aiohttp/aiohttp_ws.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py b/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py index e5575a11c..a8886f387 100644 --- a/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py +++ b/python-ecosys/aiohttp/aiohttp/aiohttp_ws.py @@ -143,7 +143,7 @@ async def handshake(self, uri, ssl, req): headers["Host"] = f"{uri.hostname}:{uri.port}" headers["Connection"] = "Upgrade" headers["Upgrade"] = "websocket" - headers["Sec-WebSocket-Key"] = key + headers["Sec-WebSocket-Key"] = key.decode() headers["Sec-WebSocket-Version"] = "13" headers["Origin"] = f"{_http_proto}://{uri.hostname}:{uri.port}"