hyper
hyper copied to clipboard
fileServer doesn't set content-type header
for things like CSS files, the content-type needs to be written as text/css for Chrome to actually use it as a stylesheet, it seems.
All right. Having Hyper guess MIME types based on file extensions seems like something we'd regret later. Perhaps some lookup table that is user-configurable, like with Nginx *https://github.com/h5bp/server-configs-nginx/blob/master/mime.types)?
yeah, something like that would probably be best. like a default set and then the user could pass in their own record of how to handle stuff
I'm very tight on time currently. If you need it soon, would you like to send a PR? Thanks!
no rush! it's just on my vidtracker and i'm handling css requests separately for now
I've added simple lookup table for mime types: https://github.com/owickstrom/hyper/blob/master/src/Hyper/Node/FileServer.purs#L28
We can break API in next release and allow users to pass their own table too if that is not enough.
@justinwoo, @owickstrom Can I close it?
Looks like a good start @paluh. :+1: And yeah, let's make it a parameter when needed.