@@ -775,6 +775,24 @@ def _token_default(self):
775775 self ._token_generated = True
776776 return binascii .hexlify (os .urandom (24 )).decode ('ascii' )
777777
778+ max_body_size = Integer (512 * 1024 * 1024 , config = True ,
779+ help = """
780+ Sets the maximum allowed size of the client request body, specified in
781+ the “Content-Length” request header field. If the size in a request
782+ exceeds the configured value, returned to the client a
783+ Malformed HTTP message is returned.
784+
785+ Note: max_body_size is applied even in streaming mode.
786+ """
787+ )
788+
789+ max_buffer_size = Integer (512 * 1024 * 1024 , config = True ,
790+ help = """
791+ Gets or sets the maximum amount of memory, in bytes, that is allocated
792+ for use by the manager of the buffers.
793+ """
794+ )
795+
778796 @observe ('token' )
779797 def _token_changed (self , change ):
780798 self ._token_generated = False
@@ -1380,7 +1398,9 @@ def init_webapp(self):
13801398
13811399 self .login_handler_class .validate_security (self , ssl_options = ssl_options )
13821400 self .http_server = httpserver .HTTPServer (self .web_app , ssl_options = ssl_options ,
1383- xheaders = self .trust_xheaders )
1401+ xheaders = self .trust_xheaders ,
1402+ max_body_size = self .max_body_size ,
1403+ max_buffer_size = self .max_buffer_size )
13841404
13851405 success = None
13861406 for port in random_ports (self .port , self .port_retries + 1 ):
0 commit comments