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

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"