mirror of https://github.com/devine-dl/devine.git
fix(Attachment): Check mime-type case-insensitively
This commit is contained in:
parent
f419e04fad
commit
06d414975c
|
@ -37,7 +37,7 @@ class Attachment:
|
||||||
mime_type = {
|
mime_type = {
|
||||||
".ttf": "application/x-truetype-font",
|
".ttf": "application/x-truetype-font",
|
||||||
".otf": "application/vnd.ms-opentype"
|
".otf": "application/vnd.ms-opentype"
|
||||||
}.get(path.suffix, mimetypes.guess_type(path)[0])
|
}.get(path.suffix.lower(), mimetypes.guess_type(path)[0])
|
||||||
if not mime_type:
|
if not mime_type:
|
||||||
raise ValueError("The attachment mime-type could not be automatically detected.")
|
raise ValueError("The attachment mime-type could not be automatically detected.")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue