canonicalwebteam.store-api 7.3.5__py3-none-any.whl → 7.3.6__py3-none-any.whl

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.

Potentially problematic release.


This version of canonicalwebteam.store-api might be problematic. Click here for more details.

@@ -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.body,
54
+ "body": _get_request_body(request),
39
55
  }
40
56
 
41
57
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: canonicalwebteam.store-api
3
- Version: 7.3.5
3
+ Version: 7.3.6
4
4
  Summary:
5
5
  License: LGPL-3.0
6
6
  License-File: LICENSE
@@ -2,13 +2,13 @@ canonicalwebteam/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,
2
2
  canonicalwebteam/exceptions.py,sha256=Uf9HxtLH5fAXPdDm6H14tA8jUxKQAWUmWIovzHLtdRw,2134
3
3
  canonicalwebteam/retry_utils.py,sha256=zGGabWzHyoXPNdwXBS_gbz3W0Qpdg3wN1G6aNy_xef8,8517
4
4
  canonicalwebteam/store_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- canonicalwebteam/store_api/base.py,sha256=4KGdGdr0phY4ouH5hCU9TXUlnePWKrPwnRHYj_hJc3w,4616
5
+ canonicalwebteam/store_api/base.py,sha256=UJ4_fJjDKGrYT7ueSfVFcPb4pQWb3PCGLGs-DztV6Ss,5138
6
6
  canonicalwebteam/store_api/dashboard.py,sha256=Dajmi-MqLLOm9ykTCJELom6peMhAYyc3mmUAUrJBC1A,22806
7
7
  canonicalwebteam/store_api/devicegw.py,sha256=SZBqfi-lWR8qEFjUihJwoPKEIsiXWn4o_R5fdU01PEE,10734
8
8
  canonicalwebteam/store_api/publishergw.py,sha256=u2D2Y76xC8ms16XTZcUe_KmRdcyzqOV2g0aN9HYZBrQ,29702
9
9
  canonicalwebteam/stores_web_redis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  canonicalwebteam/stores_web_redis/utility.py,sha256=iT5Wb6tk53ywtDVWMcfzAT_Sljmvo0bdhaUg6uepT2o,4290
11
- canonicalwebteam_store_api-7.3.5.dist-info/METADATA,sha256=emgCMsL-fyFwIbV9oTn7jw-jOfJDYQWp1n_NEiMJoc8,2357
12
- canonicalwebteam_store_api-7.3.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
13
- canonicalwebteam_store_api-7.3.5.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
14
- canonicalwebteam_store_api-7.3.5.dist-info/RECORD,,
11
+ canonicalwebteam_store_api-7.3.6.dist-info/METADATA,sha256=Trc-mne-TBRayr_bHZW6n89nXz6k1hTYYJ1vOuzTDV8,2357
12
+ canonicalwebteam_store_api-7.3.6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
13
+ canonicalwebteam_store_api-7.3.6.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
14
+ canonicalwebteam_store_api-7.3.6.dist-info/RECORD,,