removed type length check for message attachments

This commit is contained in:
DJ2LS 2024-02-08 10:06:46 +01:00
parent 4b225ce6f4
commit 96a300ada5

View file

@ -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}'")