apitally 0.18.0__tar.gz → 0.18.1__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 (55) hide show
  1. {apitally-0.18.0 → apitally-0.18.1}/.pre-commit-config.yaml +2 -2
  2. apitally-0.18.1/.tool-versions +1 -0
  3. {apitally-0.18.0 → apitally-0.18.1}/PKG-INFO +1 -1
  4. {apitally-0.18.0 → apitally-0.18.1}/apitally/starlette.py +9 -3
  5. apitally-0.18.0/.tool-versions +0 -1
  6. {apitally-0.18.0 → apitally-0.18.1}/.github/workflows/publish.yaml +0 -0
  7. {apitally-0.18.0 → apitally-0.18.1}/.github/workflows/summary.yaml +0 -0
  8. {apitally-0.18.0 → apitally-0.18.1}/.github/workflows/tests.yaml +0 -0
  9. {apitally-0.18.0 → apitally-0.18.1}/.gitignore +0 -0
  10. {apitally-0.18.0 → apitally-0.18.1}/LICENSE +0 -0
  11. {apitally-0.18.0 → apitally-0.18.1}/Makefile +0 -0
  12. {apitally-0.18.0 → apitally-0.18.1}/README.md +0 -0
  13. {apitally-0.18.0 → apitally-0.18.1}/apitally/__init__.py +0 -0
  14. {apitally-0.18.0 → apitally-0.18.1}/apitally/blacksheep.py +0 -0
  15. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/__init__.py +0 -0
  16. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/client_asyncio.py +0 -0
  17. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/client_base.py +0 -0
  18. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/client_threading.py +0 -0
  19. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/consumers.py +0 -0
  20. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/logging.py +0 -0
  21. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/request_logging.py +0 -0
  22. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/requests.py +0 -0
  23. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/sentry.py +0 -0
  24. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/server_errors.py +0 -0
  25. {apitally-0.18.0 → apitally-0.18.1}/apitally/client/validation_errors.py +0 -0
  26. {apitally-0.18.0 → apitally-0.18.1}/apitally/common.py +0 -0
  27. {apitally-0.18.0 → apitally-0.18.1}/apitally/django.py +0 -0
  28. {apitally-0.18.0 → apitally-0.18.1}/apitally/django_ninja.py +0 -0
  29. {apitally-0.18.0 → apitally-0.18.1}/apitally/django_rest_framework.py +0 -0
  30. {apitally-0.18.0 → apitally-0.18.1}/apitally/fastapi.py +0 -0
  31. {apitally-0.18.0 → apitally-0.18.1}/apitally/flask.py +0 -0
  32. {apitally-0.18.0 → apitally-0.18.1}/apitally/litestar.py +0 -0
  33. {apitally-0.18.0 → apitally-0.18.1}/apitally/py.typed +0 -0
  34. {apitally-0.18.0 → apitally-0.18.1}/pyproject.toml +0 -0
  35. {apitally-0.18.0 → apitally-0.18.1}/renovate.json +0 -0
  36. {apitally-0.18.0 → apitally-0.18.1}/tests/__init__.py +0 -0
  37. {apitally-0.18.0 → apitally-0.18.1}/tests/conftest.py +0 -0
  38. {apitally-0.18.0 → apitally-0.18.1}/tests/constants.py +0 -0
  39. {apitally-0.18.0 → apitally-0.18.1}/tests/django_ninja_urls.py +0 -0
  40. {apitally-0.18.0 → apitally-0.18.1}/tests/django_rest_framework_urls.py +0 -0
  41. {apitally-0.18.0 → apitally-0.18.1}/tests/test_blacksheep.py +0 -0
  42. {apitally-0.18.0 → apitally-0.18.1}/tests/test_client_asyncio.py +0 -0
  43. {apitally-0.18.0 → apitally-0.18.1}/tests/test_client_consumers.py +0 -0
  44. {apitally-0.18.0 → apitally-0.18.1}/tests/test_client_request_logging.py +0 -0
  45. {apitally-0.18.0 → apitally-0.18.1}/tests/test_client_requests.py +0 -0
  46. {apitally-0.18.0 → apitally-0.18.1}/tests/test_client_server_errors.py +0 -0
  47. {apitally-0.18.0 → apitally-0.18.1}/tests/test_client_threading.py +0 -0
  48. {apitally-0.18.0 → apitally-0.18.1}/tests/test_client_validation_errors.py +0 -0
  49. {apitally-0.18.0 → apitally-0.18.1}/tests/test_django_ninja.py +0 -0
  50. {apitally-0.18.0 → apitally-0.18.1}/tests/test_django_rest_framework.py +0 -0
  51. {apitally-0.18.0 → apitally-0.18.1}/tests/test_fastapi.py +0 -0
  52. {apitally-0.18.0 → apitally-0.18.1}/tests/test_flask.py +0 -0
  53. {apitally-0.18.0 → apitally-0.18.1}/tests/test_litestar.py +0 -0
  54. {apitally-0.18.0 → apitally-0.18.1}/tests/test_starlette.py +0 -0
  55. {apitally-0.18.0 → apitally-0.18.1}/uv.lock +0 -0
@@ -8,12 +8,12 @@ repos:
8
8
  - id: trailing-whitespace
9
9
  - id: mixed-line-ending
10
10
  - repo: https://github.com/charliermarsh/ruff-pre-commit
11
- rev: v0.11.10
11
+ rev: v0.11.11
12
12
  hooks:
13
13
  - id: ruff
14
14
  args: ["--fix", "--exit-non-zero-on-fix"]
15
15
  - id: ruff-format
16
16
  - repo: https://github.com/astral-sh/uv-pre-commit
17
- rev: 0.7.5
17
+ rev: 0.7.8
18
18
  hooks:
19
19
  - id: uv-lock
@@ -0,0 +1 @@
1
+ uv 0.7.8
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apitally
3
- Version: 0.18.0
3
+ Version: 0.18.1
4
4
  Summary: Simple API monitoring & analytics for REST APIs built with FastAPI, Flask, Django, Starlette, Litestar and BlackSheep.
5
5
  Project-URL: Homepage, https://apitally.io
6
6
  Project-URL: Documentation, https://docs.apitally.io
@@ -91,6 +91,7 @@ class ApitallyMiddleware:
91
91
 
92
92
  async def receive_wrapper() -> Message:
93
93
  nonlocal request_body, request_body_too_large
94
+
94
95
  message = await receive()
95
96
  if message["type"] == "http.request" and self.capture_request_body and not request_body_too_large:
96
97
  request_body += message.get("body", b"")
@@ -109,6 +110,7 @@ class ApitallyMiddleware:
109
110
  response_chunked, \
110
111
  response_content_type, \
111
112
  response_size
113
+
112
114
  if message["type"] == "http.response.start":
113
115
  response_time = time.perf_counter() - start_time
114
116
  response_status = message["status"]
@@ -120,9 +122,11 @@ class ApitallyMiddleware:
120
122
  response_content_type = response_headers.get("Content-Type")
121
123
  response_size = parse_int(response_headers.get("Content-Length")) if not response_chunked else 0
122
124
  response_body_too_large = response_size is not None and response_size > MAX_BODY_SIZE
125
+
123
126
  elif message["type"] == "http.response.body":
124
127
  if response_chunked and response_size is not None:
125
128
  response_size += len(message.get("body", b""))
129
+
126
130
  if (
127
131
  (self.capture_response_body or response_status == 422)
128
132
  and RequestLogger.is_supported_content_type(response_content_type)
@@ -132,6 +136,11 @@ class ApitallyMiddleware:
132
136
  if len(response_body) > MAX_BODY_SIZE:
133
137
  response_body_too_large = True
134
138
  response_body = b""
139
+
140
+ if self.capture_client_disconnects and await request.is_disconnected():
141
+ # Client closed connection (report NGINX specific status code)
142
+ response_status = 499
143
+
135
144
  await send(message)
136
145
 
137
146
  try:
@@ -142,9 +151,6 @@ class ApitallyMiddleware:
142
151
  finally:
143
152
  if response_time is None:
144
153
  response_time = time.perf_counter() - start_time
145
- if self.capture_client_disconnects and await request.is_disconnected():
146
- # Client closed connection (report NGINX specific status code)
147
- response_status = 499
148
154
  self.add_request(
149
155
  timestamp=timestamp,
150
156
  request=request,
@@ -1 +0,0 @@
1
- uv 0.7.5
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