canonicalwebteam.store-api 7.3.5__tar.gz → 7.3.6__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.
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/PKG-INFO +1 -1
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/store_api/base.py +17 -1
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/pyproject.toml +1 -1
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/LICENSE +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/README.md +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/__init__.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/exceptions.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/retry_utils.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/store_api/__init__.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/store_api/dashboard.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/store_api/devicegw.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/store_api/publishergw.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/stores_web_redis/__init__.py +0 -0
- {canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/stores_web_redis/utility.py +0 -0
|
@@ -30,12 +30,28 @@ def _sanitize_dict(dictionary):
|
|
|
30
30
|
return result
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
def _get_request_body(request) -> str:
|
|
34
|
+
body = request.body
|
|
35
|
+
if isinstance(body, (bytes, bytearray)):
|
|
36
|
+
# try to decode utf-8
|
|
37
|
+
try:
|
|
38
|
+
body = body.decode()
|
|
39
|
+
except UnicodeError:
|
|
40
|
+
# we don't want to guess so we just print the body's length
|
|
41
|
+
body = f"<len {len(body)}>"
|
|
42
|
+
elif not isinstance(body, str):
|
|
43
|
+
# we don't know if the type will be JSON serializable
|
|
44
|
+
# so we just print the type
|
|
45
|
+
body = f"{type(body)}"
|
|
46
|
+
return body
|
|
47
|
+
|
|
48
|
+
|
|
33
49
|
def _loggable_request(request):
|
|
34
50
|
return {
|
|
35
51
|
"url": request.url,
|
|
36
52
|
"headers": _sanitize_dict(request.headers),
|
|
37
53
|
"cookies": _sanitize_dict(request._cookies),
|
|
38
|
-
"body": request
|
|
54
|
+
"body": _get_request_body(request),
|
|
39
55
|
}
|
|
40
56
|
|
|
41
57
|
|
|
File without changes
|
|
File without changes
|
{canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/__init__.py
RENAMED
|
File without changes
|
{canonicalwebteam_store_api-7.3.5 → canonicalwebteam_store_api-7.3.6}/canonicalwebteam/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|