Default to no maximum request size for streaming handlers.
This commit is contained in:
parent
eb66621544
commit
730de6afda
11
sanic/app.py
11
sanic/app.py
|
@ -993,11 +993,12 @@ class Sanic:
|
|||
# Fetch handler from router
|
||||
handler, args, kwargs, uri, name = self.router.get(request)
|
||||
|
||||
# Non-streaming handlers have their body preloaded
|
||||
if (
|
||||
request.stream.request_body
|
||||
and not self.router.is_stream_handler(request)
|
||||
):
|
||||
if request.stream.request_body:
|
||||
if self.router.is_stream_handler(request):
|
||||
# Streaming handler: lift the size limit
|
||||
request.stream.request_max_size = float("inf")
|
||||
else:
|
||||
# Non-streaming handler: preload body
|
||||
await request.receive_body()
|
||||
|
||||
# -------------------------------------------- #
|
||||
|
|
Loading…
Reference in New Issue
Block a user