File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
tabpy/tabpy_server/handlers Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -453,17 +453,15 @@ def request_body_size_within_limit(self):
453
453
bool
454
454
True if the request body size is within the limit, False otherwise.
455
455
"""
456
- headers = self .request .headers
457
-
458
- if "Content-Length" in headers :
459
- content_length = int (headers ["Content-Length" ])
460
-
461
- if content_length > self .max_request_size :
462
- self .error_out (
463
- 413 ,
464
- info = "Request Entity Too Large" ,
465
- log_message = f"Request with size { content_length } exceeded limit of { self .max_request_size } (bytes)." ,
466
- )
467
- return False
468
-
456
+ if self .max_request_size is not None :
457
+ if "Content-Length" in self .request .headers :
458
+ content_length = int (self .request .headers ["Content-Length" ])
459
+ if content_length > self .max_request_size :
460
+ self .error_out (
461
+ 413 ,
462
+ info = "Request Entity Too Large" ,
463
+ log_message = f"Request with size { content_length } exceeded limit of { self .max_request_size } (bytes)." ,
464
+ )
465
+ return False
466
+
469
467
return True
You can’t perform that action at this time.
0 commit comments