Skip to content

Commit

Permalink
Still support <0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Nov 20, 2024
1 parent ed9902d commit 0ebbc70
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ def __init__(
self.access_logger = logging.getLogger("uvicorn.access")
self.access_log = self.access_logger.hasHandlers()
self.parser = httptools.HttpRequestParser(self)
self.parser.set_dangerous_leniencies(lenient_data_after_close=True)

try:
# Enable dangerous leniencies to allow server to a response on the first request from a pipelined request.
self.parser.set_dangerous_leniencies(lenient_data_after_close=True)
except AttributeError:
# httptools < 0.6.3
pass

self.ws_protocol_class = config.ws_protocol_class
self.root_path = config.root_path
self.limit_concurrency = config.limit_concurrency
Expand Down

0 comments on commit 0ebbc70

Please sign in to comment.