Add better feedback on upload max size failure

This commit is contained in:
amcmanu3 2022-04-02 13:06:20 -04:00
parent f00830aeb5
commit dc69a8a9f2
2 changed files with 402 additions and 350 deletions

View File

@ -113,6 +113,12 @@ class UploadHandler(BaseHandler):
self.do_upload = False
if self.do_upload:
self.content_len = int(self.request.headers.get("Content-Length"))
if self.content_len > MAX_STREAMED_SIZE:
logger.error(
f"User with ID {user_id} attempted to upload a file that"
f" exceeded the max body size."
)
try:
self.f = open(full_path, "wb")
except Exception as e:

File diff suppressed because it is too large Load Diff