scotty-web / wai-middleware-static

WAI middleware that intercepts requests to static files and serves them if they exist.
Other
18 stars 12 forks source link

Overriding MIME types #12

Closed PkmX closed 5 years ago

PkmX commented 8 years ago

I'm serving some files where I'd like to have the default MIME type guessed from the extension changed. Perhaps allow users to supply their own Network.Mime.MimeMap?

On an unrelated note, what is the exported getMimeType function for? It seems weird to expose a function when it cannot be used in this module.

Thanks!

xich commented 8 years ago

Yes, I think in general we should create some Options type that contains the cache-control stuff and a MimeMap (defaulted to the one from Network.Mime) and any other useful dials and knobs. Then we can parameterize the functions over that.

getMimeType was exported back when we implemented it ourselves (before moving to Network.Mime dependency). We could remove it.

Patches welcome!