SimonSapin/Frozen-Flask — Issue #8: Mimetype guessing is unreliable, not cross-platform
Author: benvinegar
Created: 2012-01-16 04:12:02+00:00
State: open

I'm curious why Frozen-Flask throws an exception if the mimetype of the generated file doesn't match it's own guess (from mimetypes.guess_type). I've found that mimetypes.guess_type is wholly unreliable, and returns different results depending on the platform.

For example, on Windows, ```mimetypes.guess_type('file.js')```, returns application/x-javascript, but on OS X, it returns just application/javascript. There are others like this (.json is another).

Basically, this means that if I want to write cross-platform code that builds a static website using Flask-Frozen, I have to use mimetypes.guess_type myself, just to make sure I'm passing the same mimetype that Flask-Frozen expects. That seems to defeat the purpose. I'd ask that you just remove this check, because while it's a good sanity check in theory, it doesn't work in practice.