mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
removed type length check for message attachments
This commit is contained in:
parent
4b225ce6f4
commit
96a300ada5
|
@ -9,5 +9,8 @@ def validate_message_attachment(attachment):
|
|||
for field in ['name', 'type', 'data']:
|
||||
if field not in attachment:
|
||||
raise ValueError(f"Attachment missing '{field}'")
|
||||
if len(attachment[field]) < 1:
|
||||
|
||||
# check for content length, except type
|
||||
# there are some files out there, don't having a mime type
|
||||
if len(attachment[field]) < 1 and field not in ["type"]:
|
||||
raise ValueError(f"Attachment has empty '{field}'")
|
||||
|
|
Loading…
Reference in a new issue