internal 1.1.28b0__py3-none-any.whl → 1.1.29.0__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 internal might be problematic. Click here for more details.

@@ -19,6 +19,8 @@ class LogRequestMiddleware(BaseHTTPMiddleware):
19
19
  method = request.method
20
20
  headers = request.headers
21
21
  request_id = headers.get(CORRELATION_ID_HEADER_KEY_NAME, "")
22
+ content_type = headers.get('content-type', '') or headers.get('Content-Type', '')
23
+ is_multipart = 'multipart' in content_type.lower()
22
24
 
23
25
  query_params = request.query_params
24
26
  temp = defaultdict(list)
@@ -28,7 +30,7 @@ class LogRequestMiddleware(BaseHTTPMiddleware):
28
30
  params = {k: v[0] if len(v) == 1 else v for k, v in temp.items()}
29
31
 
30
32
  body = await request.body()
31
- if "multipart" in headers.get("content-type"):
33
+ if is_multipart:
32
34
  self.logger.info(f"[Request id: {request_id}] \nURL: {method} {url} \nParams: {params} \nBody: 因上傳檔案不顯示body \nHeaders: {headers} \nstart processing...")
33
35
  else:
34
36
  self.logger.info(f"[Request id: {request_id}] \nURL: {method} {url} \nParams: {params} \nBody: {body} \nHeaders: {headers} \nstart processing...")
@@ -38,7 +40,7 @@ class LogRequestMiddleware(BaseHTTPMiddleware):
38
40
  response = await call_next(request)
39
41
  process_time = time.time() - start_time
40
42
 
41
- if "multipart" in headers.get("content-type"):
43
+ if is_multipart:
42
44
  self.logger.info(f"[Request id: {request_id}] \nURL: {method} {url} \nParams: {params} \nBody: 因上傳檔案不顯示body \nCompleted in {process_time:.4f} seconds")
43
45
  else:
44
46
  self.logger.info(f"[Request id: {request_id}] \nURL: {method} {url} \nParams: {params} \nBody: {body} \nCompleted in {process_time:.4f} seconds")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.1.28b0
3
+ Version: 1.1.29.0
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -28,12 +28,12 @@ internal/http/responses.py,sha256=zvU0iRQ9-qxeEZfKmuvTi8lv9DFcaNAsHlQKOTCpVzw,29
28
28
  internal/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  internal/interface/base_interface.py,sha256=3YaVjIgLi_pZpLk5SEIk8WVkuICM8qPavT8rB0MdB5U,1536
30
30
  internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- internal/middleware/log_request.py,sha256=cLOEKmsE5KpXmJSqy5Jqiz61vCsJAK1PXxsIyIq36Nc,1998
31
+ internal/middleware/log_request.py,sha256=OFwWnGfzXnllcQsBHolAWVsahXKoEhw3OQ1YWOm7RHM,2087
32
32
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  internal/model/base_model.py,sha256=hxleV8fYNvFgUoYmCv_inEP3kA4tD4HhCBCNFVK8SZg,5509
34
34
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
35
35
  internal/utils.py,sha256=wK1QumW1AaWE1ga2-WcDH2rtXRr2hSLwXzy-iI5dTzY,3962
36
36
  internal/validator_utils.py,sha256=CqjaVFoAu5MqvBG_AkTP-r7AliWawtUWB851USj4moI,1519
37
- internal-1.1.28b0.dist-info/METADATA,sha256=2vB7oJF_QeJP8DYccq5ilc3AOWDd4bUHXRBGo66i05o,941
38
- internal-1.1.28b0.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
- internal-1.1.28b0.dist-info/RECORD,,
37
+ internal-1.1.29.0.dist-info/METADATA,sha256=o7QnAKvYebhTICUdgxGmRJNRMMWx_Oy9XeIqiiCzMss,941
38
+ internal-1.1.29.0.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
+ internal-1.1.29.0.dist-info/RECORD,,