@@ -775,6 +775,24 @@ def _token_default(self):
775
775
self ._token_generated = True
776
776
return binascii .hexlify (os .urandom (24 )).decode ('ascii' )
777
777
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
+
778
796
@observe ('token' )
779
797
def _token_changed (self , change ):
780
798
self ._token_generated = False
@@ -1380,7 +1398,9 @@ def init_webapp(self):
1380
1398
1381
1399
self .login_handler_class .validate_security (self , ssl_options = ssl_options )
1382
1400
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 )
1384
1404
1385
1405
success = None
1386
1406
for port in random_ports (self .port , self .port_retries + 1 ):
0 commit comments