CheeseAPI 0.4.6__tar.gz → 0.4.7__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.
@@ -445,7 +445,7 @@ class Handle:
445
445
  })
446
446
 
447
447
  if e.args[0] == 0:
448
- self.websocket_404(protocol)
448
+ await self.websocket_404(protocol)
449
449
  if self._app.signal.websocket_404.receivers:
450
450
  await self._app.signal.websocket_404.send_async(**{
451
451
  'request': protocol.request,
@@ -455,7 +455,7 @@ class Handle:
455
455
  return await self.websocket_response(protocol)
456
456
 
457
457
  elif e.args[0] == 1:
458
- self.websocket_405(protocol)
458
+ await self.websocket_405(protocol)
459
459
  if self._app.signal.websocket_405.receivers:
460
460
  await self._app.signal.websocket_405.send_async(**{
461
461
  'request': protocol.request,
@@ -23,10 +23,6 @@ class HttpProtocol(asyncio.Protocol):
23
23
  self.transport = transport
24
24
 
25
25
  def data_received(self, data: bytes) -> None:
26
- self.request = None
27
- self.response = None
28
- self.kwargs = {}
29
-
30
26
  try:
31
27
  self.parser.feed_data(data)
32
28
  except httptools.HttpParserUpgrade:
@@ -39,6 +35,8 @@ class HttpProtocol(asyncio.Protocol):
39
35
 
40
36
  def on_url(self, url: bytes):
41
37
  self.request = Request(http.HTTPMethod(self.parser.get_method().decode()), url.decode())
38
+ self.response = None
39
+ self.kwargs = {}
42
40
 
43
41
  def on_header(self, key: bytes, value: bytes):
44
42
  self.request.headers['-'.join([t.capitalize() for t in key.decode().split('-')])] = value.decode()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: CheeseAPI
3
- Version: 0.4.6
3
+ Version: 0.4.7
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 = "0.4.6"
7
+ version = "0.4.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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes