File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 27
27
UploadDestinationHandler ,
28
28
)
29
29
import tornado
30
+ from tornado .http1connection import HTTP1Connection
30
31
import tabpy .tabpy_server .app .arrow_server as pa
31
32
import _thread
32
33
@@ -497,3 +498,16 @@ def _build_tabpy_state(self):
497
498
logger .info (f"Loading state from state file { state_file_path } " )
498
499
tabpy_state = _get_state_from_file (state_file_dir )
499
500
return tabpy_state , TabPyState (config = tabpy_state , settings = self .settings )
501
+
502
+
503
+ # Override _read_body to allow content with size exceeding max_body_size
504
+ # This enables proper handling of 413 errors in base_handler
505
+ def _read_body_allow_max_size (self , code , headers , delegate ):
506
+ if "Content-Length" in headers :
507
+ content_length = int (headers ["Content-Length" ])
508
+ if content_length > self ._max_body_size :
509
+ return
510
+ return self .original_read_body (code , headers , delegate )
511
+
512
+ HTTP1Connection .original_read_body = HTTP1Connection ._read_body
513
+ HTTP1Connection ._read_body = _read_body_allow_max_size
You can’t perform that action at this time.
0 commit comments