Skip to content

Commit 0ebbc70

Browse files
committed
Still support <0.6.3
1 parent ed9902d commit 0ebbc70

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

uvicorn/protocols/http/httptools_impl.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ def __init__(
5858
self.access_logger = logging.getLogger("uvicorn.access")
5959
self.access_log = self.access_logger.hasHandlers()
6060
self.parser = httptools.HttpRequestParser(self)
61-
self.parser.set_dangerous_leniencies(lenient_data_after_close=True)
61+
62+
try:
63+
# Enable dangerous leniencies to allow server to a response on the first request from a pipelined request.
64+
self.parser.set_dangerous_leniencies(lenient_data_after_close=True)
65+
except AttributeError:
66+
# httptools < 0.6.3
67+
pass
68+
6269
self.ws_protocol_class = config.ws_protocol_class
6370
self.root_path = config.root_path
6471
self.limit_concurrency = config.limit_concurrency

0 commit comments

Comments
 (0)