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.
@@ -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
- await self.app.printer.websocket_error(e, self.websocket)
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 = {
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: CheeseAPI
3
- Version: 2.0.8b6
3
+ Version: 2.0.8b7
4
4
  Summary: 一款web协程框架
5
5
  Project-URL: Source, https://github.com/CheeseUnknown/CheeseAPI
6
6
  Author-email: Cheese Unknown <cheese@cheese.ren>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "CheeseAPI"
7
- version = "2.0.8-beta.6"
7
+ version = "2.0.8-beta.7"
8
8
  description = "一款web协程框架"
9
9
  readme = "README.md"
10
10
  license-files = { paths = [ "LICENSE" ] }
File without changes
File without changes
File without changes