CheeseAPI 0.2.10__tar.gz → 0.2.12__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.
Files changed (26) hide show
  1. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/handle.py +2 -2
  2. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/request.py +5 -5
  3. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI.egg-info/PKG-INFO +1 -1
  4. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/PKG-INFO +1 -1
  5. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/setup.py +1 -1
  6. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/__init__.py +0 -0
  7. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/app.py +0 -0
  8. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/cors.py +0 -0
  9. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/exception.py +0 -0
  10. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/file.py +0 -0
  11. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/module.py +0 -0
  12. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/protocol.py +0 -0
  13. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/response.py +0 -0
  14. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/route.py +0 -0
  15. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/server.py +0 -0
  16. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/signal.py +0 -0
  17. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/websocket.py +0 -0
  18. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/worker.py +0 -0
  19. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI/workspace.py +0 -0
  20. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI.egg-info/SOURCES.txt +0 -0
  21. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI.egg-info/dependency_links.txt +0 -0
  22. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI.egg-info/requires.txt +0 -0
  23. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/CheeseAPI.egg-info/top_level.txt +0 -0
  24. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/LICENSE +0 -0
  25. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/README.md +0 -0
  26. {CheeseAPI-0.2.10 → CheeseAPI-0.2.12}/setup.cfg +0 -0
@@ -40,7 +40,7 @@ class Handle:
40
40
  if await self._http_responseHandle(protocol, app, await self._http_404Handle(protocol, app)):
41
41
  return
42
42
 
43
- if protocol.request.method not in funcs or funcs[protocol.request.method] is None:
43
+ if protocol.request.method not in funcs:
44
44
  if protocol.request.method == http.HTTPMethod.OPTIONS and (app.cors.origin == '*' or protocol.request.method in app.cors.origin):
45
45
  if await self._http_responseHandle(protocol, app, await self._http_optionsHandle(protocol, app)):
46
46
  return
@@ -240,7 +240,7 @@ A usable BaseResponse is not returned''')
240
240
  logger.http(f'The {protocol.request.headers.get("X-Forwarded-For").split(", ")[0]} accessed {protocol.request.method} {protocol.request.fullPath} and returned {response.status}', f'The <cyan>{protocol.request.headers.get("X-Forwarded-For").split(", ")[0]}</cyan> accessed <cyan>{protocol.request.method} ' + logger.encode(protocol.request.fullPath) + f'</cyan> and returned <blue>{response.status}</blue>')
241
241
 
242
242
  if protocol.transport.is_closing():
243
- return
243
+ return True
244
244
 
245
245
  if protocol.timeoutTask:
246
246
  protocol.timeoutTask.cancel()
@@ -38,13 +38,13 @@ class Request:
38
38
  if 'Content-Type' in self.headers:
39
39
  _value = self.headers.get('Content-Type')
40
40
  try:
41
- if _value in [ 'application/json', 'application/javascript' ]:
41
+ if 'application/json' in _value or 'application/javascript' in _value:
42
42
  self._body = json.loads(value)
43
- elif _value == 'application/xml':
43
+ elif 'application/xml' in _value:
44
44
  self._body = xmltodict.parse(value)
45
- elif _value in [ 'text/plain', 'text/html' ]:
45
+ elif 'text/plain' in _value or 'text/html' in _value:
46
46
  self._body = value.decode()
47
- elif _value.startswith('multipart/form-data;'):
47
+ elif 'multipart/form-data' in _value:
48
48
  spliter = _value.split('boundary=')[1].split(';')[0]
49
49
  body = value.split(b'--' + spliter.encode())[1:-1]
50
50
  for s in body:
@@ -55,7 +55,7 @@ class Request:
55
55
  self.form[key] = File(filename[0].decode(), value)
56
56
  else:
57
57
  self.form[key] = value.decode()
58
- elif _value == 'application/x-www-form-urlencoded':
58
+ elif 'application/x-www-form-urlencoded' in _value:
59
59
  for s in value.decode().split('&'):
60
60
  s = s.split('=')
61
61
  self.form[unquote(s[0])] = unquote(s[1].replace(r'+', r'%20'))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CheeseAPI
3
- Version: 0.2.10
3
+ Version: 0.2.12
4
4
  Summary: 一款web协程框架
5
5
  Home-page: https://github.com/CheeseUnknown/CheeseAPI
6
6
  Author: Cheese Unknown
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: CheeseAPI
3
- Version: 0.2.10
3
+ Version: 0.2.12
4
4
  Summary: 一款web协程框架
5
5
  Home-page: https://github.com/CheeseUnknown/CheeseAPI
6
6
  Author: Cheese Unknown
@@ -5,7 +5,7 @@ with open('./README.md', 'r', encoding = 'utf-8') as f:
5
5
 
6
6
  setuptools.setup(
7
7
  name = 'CheeseAPI',
8
- version = '0.2.10',
8
+ version = '0.2.12',
9
9
  author = 'Cheese Unknown',
10
10
  author_email = 'cheese@cheese.ren',
11
11
  description = '一款web协程框架',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes