-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
Incorrect MIME type for templated javascript module imports #829
Comments
I think the mimetypes standard library on windows doesn't properly locate the correct dictionary of all known types resulting in some files being mischaracterized as ("text/plain"). To get around this issue, I forcibly imported, initiated and added keys to mimetypes
and here:
And the resulting web app correctly serves the files as the appropriate MIME content type. |
Okay, so a useful thing to do here would be to start by confirming that. Want to try opening up python in a console, and just using... from mimetypes import guess_type
print(guess_type("something.js"))
print(guess_type("something.css"))
print(guess_type("something.svg")) If there is an issue with mimetypes support being pretty unreliable, then we could take a look at including some defaults for basic HTML related content. |
While looking for solutions to a related problem concerning content types and the |
If on windows, it's a windows registry issue. See the issue linked by @Xevion above me for more information about the registry. On windows, python relies fully on the registry for the mime types EDIT additional info: I had a similar issue at one point for just css files. I had to edit the windows registry key |
Greetings all,
I cannot seem to find where one explicitly defines mime types for imports. My browser is blocking all javascript module imports due to the server serving them as (“text/plain”). I realize this is a simple configuration issue, but I cannot seem to find where to set it. Any assistance provided is greatly appreciated. The console error shown below with my python 'app'.
I am running Win10 x64, Firefox 73.0 (64-bit), Python 3.7, uvicorn 0.11.2, and starlette 0.13.1.
I also posted this in the uvicorn issues.
The text was updated successfully, but these errors were encountered: