]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Allowed set max_body_size to 0
authorSakuya <dl@pbstu.com>
Mon, 15 Mar 2021 20:11:18 +0000 (04:11 +0800)
committerGitHub <noreply@github.com>
Mon, 15 Mar 2021 20:11:18 +0000 (04:11 +0800)
tornado/http1connection.py

index 77b1cda7db0d4b6d102b86e7283a1f618c5af391..dd9494fc659001ab7953f6742f5c4d5d2c9b2bd9 100644 (file)
@@ -131,7 +131,7 @@ class HTTP1Connection(httputil.HTTPConnection):
         self.no_keep_alive = params.no_keep_alive
         # The body limits can be altered by the delegate, so save them
         # here instead of just referencing self.params later.
-        self._max_body_size = self.params.max_body_size or self.stream.max_buffer_size
+        self._max_body_size = self.params.max_body_size if self.params.max_body_size is not None else self.stream.max_buffer_size
         self._body_timeout = self.params.body_timeout
         # _write_finished is set to True when finish() has been called,
         # i.e. there will be no more data sent.  Data may still be in the