Skip to content
New issue

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 returns incorrect MIME type if extension has capital letters #213

Closed
2 tasks done
sanand0 opened this issue Dec 16, 2019 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working files FileHandler capability good first issue

Comments

@sanand0
Copy link
Contributor

sanand0 commented Dec 16, 2019

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:

@sanand0 sanand0 added bug Something isn't working files FileHandler capability labels Dec 16, 2019
@pratapvardhan
Copy link
Collaborator

closed via a96d729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working files FileHandler capability good first issue
Projects
None yet
Development

No branches or pull requests

2 participants