tigrcorn-asgi 0.3.18.dev2__tar.gz → 0.3.19__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.
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/PKG-INFO +3 -3
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/README.md +1 -1
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/pyproject.toml +2 -2
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/receive.py +11 -5
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi.egg-info/PKG-INFO +3 -3
- tigrcorn_asgi-0.3.19/src/tigrcorn_asgi.egg-info/requires.txt +1 -0
- tigrcorn_asgi-0.3.18.dev2/src/tigrcorn_asgi.egg-info/requires.txt +0 -1
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/LICENSE +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/setup.cfg +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/__init__.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/connection.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/errors.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/events/__init__.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/events/custom.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/events/http.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/events/lifespan.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/events/websocket.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/extensions/__init__.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/extensions/tls.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/extensions/websocket_denial.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/py.typed +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/scopes/__init__.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/scopes/custom.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/scopes/http.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/scopes/lifespan.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/scopes/websocket.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/__init__.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/collector.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/helpers.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/lifespan.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/materialize.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/segments.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/validation.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/send/writer.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/state.py +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi.egg-info/SOURCES.txt +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi.egg-info/dependency_links.txt +0 -0
- {tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tigrcorn-asgi
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.19
|
|
4
4
|
Summary: ASGI3 scope, event, receive/send, and extension primitives for the Tigrcorn Python web server.
|
|
5
5
|
Author-email: Jacob Stewart <jacob@swarmauri.com>
|
|
6
6
|
License: Apache License
|
|
@@ -186,7 +186,7 @@ Classifier: Typing :: Typed
|
|
|
186
186
|
Requires-Python: <3.15,>=3.10
|
|
187
187
|
Description-Content-Type: text/markdown
|
|
188
188
|
License-File: LICENSE
|
|
189
|
-
Requires-Dist: tigrcorn-core==0.3.
|
|
189
|
+
Requires-Dist: tigrcorn-core==0.3.19
|
|
190
190
|
Dynamic: license-file
|
|
191
191
|
|
|
192
192
|
<div align="center">
|
|
@@ -275,7 +275,7 @@ The package exposes its supported public surface through the <code>tigrcorn_asgi
|
|
|
275
275
|
|
|
276
276
|
## Package Graph
|
|
277
277
|
|
|
278
|
-
[tigrcorn-core](https://pypi.org/project/tigrcorn-core/) | [tigrcorn-config](https://pypi.org/project/tigrcorn-config/) | [tigrcorn-http](https://pypi.org/project/tigrcorn-http/) | [tigrcorn-asgi](https://pypi.org/project/tigrcorn-asgi/) | [tigrcorn-contract](https://pypi.org/project/tigrcorn-contract/) | [tigrcorn-transports](https://pypi.org/project/tigrcorn-transports/) | [tigrcorn-security](https://pypi.org/project/tigrcorn-security/) | [tigrcorn-protocols](https://pypi.org/project/tigrcorn-protocols/) | [tigrcorn-static](https://pypi.org/project/tigrcorn-static/) | [tigrcorn-observability](https://pypi.org/project/tigrcorn-observability/) | [tigrcorn-runtime](https://pypi.org/project/tigrcorn-runtime/) | [tigrcorn-compat](https://pypi.org/project/tigrcorn-compat/) | [tigrcorn-certification](https://pypi.org/project/tigrcorn-certification/)
|
|
278
|
+
[tigrcorn-core](https://pypi.org/project/tigrcorn-core/) | [tigrcorn-quic-cc](https://pypi.org/project/tigrcorn-quic-cc/) | [tigrcorn-quic-cc-reno](https://pypi.org/project/tigrcorn-quic-cc-reno/) | [tigrcorn-config](https://pypi.org/project/tigrcorn-config/) | [tigrcorn-http](https://pypi.org/project/tigrcorn-http/) | [tigrcorn-asgi](https://pypi.org/project/tigrcorn-asgi/) | [tigrcorn-contract](https://pypi.org/project/tigrcorn-contract/) | [tigrcorn-transports](https://pypi.org/project/tigrcorn-transports/) | [tigrcorn-security](https://pypi.org/project/tigrcorn-security/) | [tigrcorn-protocols](https://pypi.org/project/tigrcorn-protocols/) | [tigrcorn-static](https://pypi.org/project/tigrcorn-static/) | [tigrcorn-observability](https://pypi.org/project/tigrcorn-observability/) | [tigrcorn-runtime](https://pypi.org/project/tigrcorn-runtime/) | [tigrcorn-compat](https://pypi.org/project/tigrcorn-compat/) | [tigrcorn-certification](https://pypi.org/project/tigrcorn-certification/)
|
|
279
279
|
|
|
280
280
|
## Best Practices
|
|
281
281
|
|
|
@@ -84,7 +84,7 @@ The package exposes its supported public surface through the <code>tigrcorn_asgi
|
|
|
84
84
|
|
|
85
85
|
## Package Graph
|
|
86
86
|
|
|
87
|
-
[tigrcorn-core](https://pypi.org/project/tigrcorn-core/) | [tigrcorn-config](https://pypi.org/project/tigrcorn-config/) | [tigrcorn-http](https://pypi.org/project/tigrcorn-http/) | [tigrcorn-asgi](https://pypi.org/project/tigrcorn-asgi/) | [tigrcorn-contract](https://pypi.org/project/tigrcorn-contract/) | [tigrcorn-transports](https://pypi.org/project/tigrcorn-transports/) | [tigrcorn-security](https://pypi.org/project/tigrcorn-security/) | [tigrcorn-protocols](https://pypi.org/project/tigrcorn-protocols/) | [tigrcorn-static](https://pypi.org/project/tigrcorn-static/) | [tigrcorn-observability](https://pypi.org/project/tigrcorn-observability/) | [tigrcorn-runtime](https://pypi.org/project/tigrcorn-runtime/) | [tigrcorn-compat](https://pypi.org/project/tigrcorn-compat/) | [tigrcorn-certification](https://pypi.org/project/tigrcorn-certification/)
|
|
87
|
+
[tigrcorn-core](https://pypi.org/project/tigrcorn-core/) | [tigrcorn-quic-cc](https://pypi.org/project/tigrcorn-quic-cc/) | [tigrcorn-quic-cc-reno](https://pypi.org/project/tigrcorn-quic-cc-reno/) | [tigrcorn-config](https://pypi.org/project/tigrcorn-config/) | [tigrcorn-http](https://pypi.org/project/tigrcorn-http/) | [tigrcorn-asgi](https://pypi.org/project/tigrcorn-asgi/) | [tigrcorn-contract](https://pypi.org/project/tigrcorn-contract/) | [tigrcorn-transports](https://pypi.org/project/tigrcorn-transports/) | [tigrcorn-security](https://pypi.org/project/tigrcorn-security/) | [tigrcorn-protocols](https://pypi.org/project/tigrcorn-protocols/) | [tigrcorn-static](https://pypi.org/project/tigrcorn-static/) | [tigrcorn-observability](https://pypi.org/project/tigrcorn-observability/) | [tigrcorn-runtime](https://pypi.org/project/tigrcorn-runtime/) | [tigrcorn-compat](https://pypi.org/project/tigrcorn-compat/) | [tigrcorn-certification](https://pypi.org/project/tigrcorn-certification/)
|
|
88
88
|
|
|
89
89
|
## Best Practices
|
|
90
90
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tigrcorn-asgi"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.19"
|
|
8
8
|
description = "ASGI3 scope, event, receive/send, and extension primitives for the Tigrcorn Python web server."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10,<3.15"
|
|
@@ -28,7 +28,7 @@ classifiers = [
|
|
|
28
28
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
29
29
|
"Typing :: Typed",
|
|
30
30
|
]
|
|
31
|
-
dependencies = ["tigrcorn-core==0.3.
|
|
31
|
+
dependencies = ["tigrcorn-core==0.3.19"]
|
|
32
32
|
|
|
33
33
|
[tool.setuptools]
|
|
34
34
|
package-dir = {"" = "src"}
|
|
@@ -5,7 +5,7 @@ from collections.abc import Awaitable, Callable
|
|
|
5
5
|
|
|
6
6
|
from tigrcorn_asgi.events.http import http_disconnect, http_request, http_request_trailers
|
|
7
7
|
from tigrcorn_asgi.events.lifespan import lifespan_shutdown, lifespan_startup
|
|
8
|
-
from tigrcorn_core.errors import ProtocolError
|
|
8
|
+
from tigrcorn_core.errors import ProtocolError, RequestBodyTooLarge
|
|
9
9
|
from tigrcorn_protocols.http1.parser import _validate_header_name, _validate_header_value
|
|
10
10
|
from tigrcorn_core.types import Message, StreamReaderLike
|
|
11
11
|
|
|
@@ -133,12 +133,15 @@ class HTTPStreamingRequestReceive:
|
|
|
133
133
|
self._sent_final = False
|
|
134
134
|
self._disconnected = False
|
|
135
135
|
self._total_read = 0
|
|
136
|
+
self.body_too_large = False
|
|
136
137
|
self.body_complete = not chunked and (content_length is None or content_length == 0)
|
|
137
138
|
self._trailers_sent = False
|
|
138
139
|
self.trailer_policy = trailer_policy
|
|
139
140
|
self.trailers: list[tuple[bytes, bytes]] = []
|
|
140
141
|
|
|
141
142
|
async def __call__(self) -> Message:
|
|
143
|
+
if self.body_too_large:
|
|
144
|
+
raise RequestBodyTooLarge('request body exceeds configured max_body_size')
|
|
142
145
|
if self._disconnected:
|
|
143
146
|
return http_disconnect()
|
|
144
147
|
if self._sent_final:
|
|
@@ -155,17 +158,21 @@ class HTTPStreamingRequestReceive:
|
|
|
155
158
|
self._sent_final = True
|
|
156
159
|
return http_request(b'', False)
|
|
157
160
|
amount = min(self._remaining, self._max_chunk_size)
|
|
161
|
+
self._check_body_size(amount)
|
|
158
162
|
data = await self._readexactly(amount)
|
|
159
163
|
self._remaining -= len(data)
|
|
160
164
|
self._total_read += len(data)
|
|
161
|
-
if self._total_read > self._max_body_size:
|
|
162
|
-
raise ProtocolError('request body exceeds configured max_body_size')
|
|
163
165
|
more_body = self._remaining > 0
|
|
164
166
|
if not more_body:
|
|
165
167
|
self.body_complete = True
|
|
166
168
|
self._sent_final = True
|
|
167
169
|
return http_request(data, more_body)
|
|
168
170
|
|
|
171
|
+
def _check_body_size(self, amount: int) -> None:
|
|
172
|
+
if self._total_read + amount > self._max_body_size:
|
|
173
|
+
self.body_too_large = True
|
|
174
|
+
raise RequestBodyTooLarge('request body exceeds configured max_body_size')
|
|
175
|
+
|
|
169
176
|
async def _maybe_send_continue(self) -> None:
|
|
170
177
|
if (
|
|
171
178
|
self._expect_continue
|
|
@@ -220,13 +227,12 @@ class HTTPStreamingRequestReceive:
|
|
|
220
227
|
self.body_complete = True
|
|
221
228
|
self._sent_final = True
|
|
222
229
|
return http_request(b'', False)
|
|
230
|
+
self._check_body_size(size)
|
|
223
231
|
data = await self._readexactly(size)
|
|
224
232
|
terminator = await self._readexactly(2)
|
|
225
233
|
if terminator != b'\r\n':
|
|
226
234
|
raise ProtocolError('invalid chunk terminator')
|
|
227
235
|
self._total_read += size
|
|
228
|
-
if self._total_read > self._max_body_size:
|
|
229
|
-
raise ProtocolError('request body exceeds configured max_body_size')
|
|
230
236
|
return http_request(data, True)
|
|
231
237
|
|
|
232
238
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tigrcorn-asgi
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.19
|
|
4
4
|
Summary: ASGI3 scope, event, receive/send, and extension primitives for the Tigrcorn Python web server.
|
|
5
5
|
Author-email: Jacob Stewart <jacob@swarmauri.com>
|
|
6
6
|
License: Apache License
|
|
@@ -186,7 +186,7 @@ Classifier: Typing :: Typed
|
|
|
186
186
|
Requires-Python: <3.15,>=3.10
|
|
187
187
|
Description-Content-Type: text/markdown
|
|
188
188
|
License-File: LICENSE
|
|
189
|
-
Requires-Dist: tigrcorn-core==0.3.
|
|
189
|
+
Requires-Dist: tigrcorn-core==0.3.19
|
|
190
190
|
Dynamic: license-file
|
|
191
191
|
|
|
192
192
|
<div align="center">
|
|
@@ -275,7 +275,7 @@ The package exposes its supported public surface through the <code>tigrcorn_asgi
|
|
|
275
275
|
|
|
276
276
|
## Package Graph
|
|
277
277
|
|
|
278
|
-
[tigrcorn-core](https://pypi.org/project/tigrcorn-core/) | [tigrcorn-config](https://pypi.org/project/tigrcorn-config/) | [tigrcorn-http](https://pypi.org/project/tigrcorn-http/) | [tigrcorn-asgi](https://pypi.org/project/tigrcorn-asgi/) | [tigrcorn-contract](https://pypi.org/project/tigrcorn-contract/) | [tigrcorn-transports](https://pypi.org/project/tigrcorn-transports/) | [tigrcorn-security](https://pypi.org/project/tigrcorn-security/) | [tigrcorn-protocols](https://pypi.org/project/tigrcorn-protocols/) | [tigrcorn-static](https://pypi.org/project/tigrcorn-static/) | [tigrcorn-observability](https://pypi.org/project/tigrcorn-observability/) | [tigrcorn-runtime](https://pypi.org/project/tigrcorn-runtime/) | [tigrcorn-compat](https://pypi.org/project/tigrcorn-compat/) | [tigrcorn-certification](https://pypi.org/project/tigrcorn-certification/)
|
|
278
|
+
[tigrcorn-core](https://pypi.org/project/tigrcorn-core/) | [tigrcorn-quic-cc](https://pypi.org/project/tigrcorn-quic-cc/) | [tigrcorn-quic-cc-reno](https://pypi.org/project/tigrcorn-quic-cc-reno/) | [tigrcorn-config](https://pypi.org/project/tigrcorn-config/) | [tigrcorn-http](https://pypi.org/project/tigrcorn-http/) | [tigrcorn-asgi](https://pypi.org/project/tigrcorn-asgi/) | [tigrcorn-contract](https://pypi.org/project/tigrcorn-contract/) | [tigrcorn-transports](https://pypi.org/project/tigrcorn-transports/) | [tigrcorn-security](https://pypi.org/project/tigrcorn-security/) | [tigrcorn-protocols](https://pypi.org/project/tigrcorn-protocols/) | [tigrcorn-static](https://pypi.org/project/tigrcorn-static/) | [tigrcorn-observability](https://pypi.org/project/tigrcorn-observability/) | [tigrcorn-runtime](https://pypi.org/project/tigrcorn-runtime/) | [tigrcorn-compat](https://pypi.org/project/tigrcorn-compat/) | [tigrcorn-certification](https://pypi.org/project/tigrcorn-certification/)
|
|
279
279
|
|
|
280
280
|
## Best Practices
|
|
281
281
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tigrcorn-core==0.3.19
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
tigrcorn-core==0.3.18.dev2
|
|
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
|
{tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi/extensions/websocket_denial.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
|
|
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
|
{tigrcorn_asgi-0.3.18.dev2 → tigrcorn_asgi-0.3.19}/src/tigrcorn_asgi.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|