CheeseAPI 1.3.1__tar.gz → 1.3.3__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-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/request.py +1 -1
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/response.py +2 -1
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/server.py +4 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/validator.py +7 -5
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/PKG-INFO +1 -1
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/pyproject.toml +1 -1
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/.gitignore +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/__init__.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/app.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/cors.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/exception.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/file.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/handle.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/protocol.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/route.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/schedule.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/signal.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/text.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/websocket.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/CheeseAPI/workspace.py +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/LICENSE +0 -0
- {cheeseapi-1.3.1 → cheeseapi-1.3.3}/README.md +0 -0
|
@@ -360,6 +360,7 @@ class BaseResponse:
|
|
|
360
360
|
'Transfer-Encoding': 'chunked',
|
|
361
361
|
**headers
|
|
362
362
|
}
|
|
363
|
+
self.headers['Content-Type'] += '; charset=utf-8'
|
|
363
364
|
self.body: str | bytes | Callable | AsyncIterator = self.status.description if body is None else body
|
|
364
365
|
self._transfering: bool = False
|
|
365
366
|
|
|
@@ -464,7 +465,7 @@ class JsonResponse(BaseResponse):
|
|
|
464
465
|
|
|
465
466
|
def __init__(self, body: dict | list = {}, status: http.HTTPStatus | int = http.HTTPStatus.OK, headers: Dict[str, str] = {}):
|
|
466
467
|
super().__init__(json.dumps(body), status, {
|
|
467
|
-
'Content-Type': 'application/json
|
|
468
|
+
'Content-Type': 'application/json',
|
|
468
469
|
**headers
|
|
469
470
|
})
|
|
470
471
|
|
|
@@ -62,18 +62,20 @@ def validator(validator: BaseModel):
|
|
|
62
62
|
|
|
63
63
|
_kwargs = {}
|
|
64
64
|
for key in validator.model_fields.keys():
|
|
65
|
-
_kwargs[key] = None
|
|
66
|
-
|
|
67
65
|
for scope in [ 'path', 'args', 'form', 'cookie', 'headers' ]:
|
|
68
66
|
try:
|
|
69
67
|
if scope == 'path':
|
|
70
|
-
_kwargs[key] = kwargs
|
|
68
|
+
_kwargs[key] = kwargs[key]
|
|
71
69
|
elif scope == 'headers':
|
|
72
|
-
_kwargs[key] = getattr(request, scope)
|
|
70
|
+
_kwargs[key] = getattr(request, scope)[key.replace('_', '-')]
|
|
73
71
|
else:
|
|
74
|
-
_kwargs[key] = getattr(request, scope)
|
|
72
|
+
_kwargs[key] = getattr(request, scope)[key]
|
|
75
73
|
|
|
76
74
|
if _kwargs.get(key):
|
|
75
|
+
try:
|
|
76
|
+
_kwargs[key] = json.loads(_kwargs[key])
|
|
77
|
+
except:
|
|
78
|
+
...
|
|
77
79
|
break
|
|
78
80
|
except:
|
|
79
81
|
...
|
|
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
|
|
File without changes
|