-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
Warn and fix missing mime types #1050
Conversation
I'll review this evening. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should be really trying to patch this or just warning about it and linking to resources on the Windows mimetype registry - neither Starlette nor Flask appear to make any similar attempt.
I thought the same thing at first. But the patch is a harmless fix for I didn't want to link to anything specific since the repair method depends on operating system. This issue technically isn't limited to Windows, but it is far more likely to happen on Windows. I will update the comment to be more specific about this issue being OS independent. |
I just merged a fix for the |
Co-authored-by: Ryan Morshead <ryan.morshead@gmail.com>
After that last comment LGTM |
Issues
N/A
Summary
Windows registry can sometimes go corrupt causing missing mime types. This results in our backends assuming all file types are
text/plain
. Ultimately, this causes us to fail to serve our ReactPy clientindex.js
.This PR aims to only resolve a minimal set of file extensions (only the ones we potentially use within ReactPy core). I considered using a more comprehensive
mime_types
list from this repo, but it seems a bit overkill for us right now. We may want to use it if we need to serve a variety of static files.Checklist
changelog.rst
has been updated with any significant changes.