mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add better feedback on upload max size failure
This commit is contained in:
parent
f00830aeb5
commit
dc69a8a9f2
@ -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
Loading…
Reference in New Issue
Block a user