CheeseAPI 2.0.8b6__tar.gz → 2.0.8b7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/websocket.py +6 -4
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/PKG-INFO +2 -2
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/pyproject.toml +1 -1
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/.gitignore +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/__init__.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/app.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/cors.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/file.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/printer.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/request.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/response.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/route.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/scheduler.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/signal.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/static.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/CheeseAPI/validator.py +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/LICENSE +0 -0
- {cheeseapi-2.0.8b6 → cheeseapi-2.0.8b7}/README.md +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import base64, hashlib, asyncio, ssl, struct, json
|
|
1
|
+
import base64, hashlib, asyncio, ssl, struct, json, inspect
|
|
2
2
|
from functools import partial
|
|
3
3
|
from typing import TYPE_CHECKING, AsyncIterable, Self
|
|
4
4
|
|
|
@@ -48,8 +48,8 @@ class Websocket:
|
|
|
48
48
|
self._request: 'Request' = request
|
|
49
49
|
|
|
50
50
|
self._proxy: 'WebsocketProxy' = request._proxy.app.WebsocketProxy_Class(request._proxy.app, self)
|
|
51
|
-
self._key: str = self.request.headers.get('Sec-WebSocket-Key')
|
|
52
|
-
subprotocols = self.request.headers.get('Sec-WebSocket-Protocol')
|
|
51
|
+
self._key: str = self.request.headers.get('sec-websocket-key') or self.request.headers.get('Sec-WebSocket-Key')
|
|
52
|
+
subprotocols = self.request.headers.get('sec-websocket-protocol') or self.request.headers.get('Sec-WebSocket-Protocol')
|
|
53
53
|
self._subprotocols: list[str] | None = subprotocols.strip().split(',') if subprotocols else None
|
|
54
54
|
self._subprotocol: str | None = None
|
|
55
55
|
self.response: Response | None = None
|
|
@@ -225,7 +225,9 @@ class WebsocketProxy:
|
|
|
225
225
|
await self.message()
|
|
226
226
|
await self.disconnect()
|
|
227
227
|
except Exception as e:
|
|
228
|
-
|
|
228
|
+
result = self.app.printer.websocket_error(e, self.websocket)
|
|
229
|
+
if inspect.isawaitable(result):
|
|
230
|
+
await result
|
|
229
231
|
|
|
230
232
|
async def get_response(self) -> Response:
|
|
231
233
|
headers = {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|