Message392294
This isn't *technically* a bug in Python, but it really presents like one. I like to run the http.server for quick-and-dirty web development, but today Chrome refused to load any of my .js files because the server is returning a MIME type of 'text/plain'. I downloaded server.py and played with it for a while, and realized that mimetypes.guess_type() is returning 'text/plain' for .js files. So then I read further into the code and realized that mimetypes is harvesting MIME types from the Windows registry. And for some reason, at least on my machine, HKEY_CLASSES_ROOT\.js\Content Type was 'text/plain'. Changing it to 'application/javascript' fixed my issue, but I'm guessing that a lot of Python devs won't bother to dig this deep. I don't know what an appropriate fix would be, other than to probably trust the built-in MIME types over the ones harvested from Windows. |
|
Date |
User |
Action |
Args |
2021-04-29 09:15:48 | smeans | set | recipients:
+ smeans |
2021-04-29 09:15:48 | smeans | set | messageid: <1619687748.29.0.910634957661.issue43975@roundup.psfhosted.org> |
2021-04-29 09:15:48 | smeans | link | issue43975 messages |
2021-04-29 09:15:48 | smeans | create | |
|