Ignore non string attachment mimetypes (#429)

This commit is contained in:
Michael Manfre 2023-01-16 17:10:03 -05:00 committed by GitHub
parent 50f8c8040d
commit 77ba7b02b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -843,7 +843,7 @@ class Post(StatorModel):
else:
focal_x, focal_y = None, None
mimetype = attachment.get("mediaType")
if not mimetype:
if not mimetype or not isinstance(mimetype, str):
mimetype, _ = mimetypes.guess_type(attachment["url"])
if not mimetype:
mimetype = "application/octet-stream"