We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileHandler checks file extensions to get the MIME type. But this fails if the extension has capital letters. For example:
>>> mimetypes.types_map.get('.jpg') 'image/jpeg' >>> mimetypes.types_map.get('.JPG') None
Impact: .JPG files are served as text.
Solution:
self.file.suffix
self.file.suffix.lower()
The text was updated successfully, but these errors were encountered:
FIX: FileHandler case insensitive MIME type #213
a96d729
closed via a96d729
Sorry, something went wrong.
No branches or pull requests
FileHandler checks file extensions to get the MIME type. But this fails if the extension has capital letters. For example:
Impact: .JPG files are served as text.
Solution:
self.file.suffix
withself.file.suffix.lower()
The text was updated successfully, but these errors were encountered: