Skip to content
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

fileServer doesn't set content-type header #42

Open
justinwoo opened this issue Aug 19, 2017 · 6 comments
Open

fileServer doesn't set content-type header #42

justinwoo opened this issue Aug 19, 2017 · 6 comments

Comments

@justinwoo
Copy link
Contributor

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.

@owickstrom
Copy link
Collaborator

owickstrom commented Aug 31, 2017

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)?

@justinwoo
Copy link
Contributor Author

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

@owickstrom
Copy link
Collaborator

I'm very tight on time currently. If you need it soon, would you like to send a PR? Thanks!

@justinwoo
Copy link
Contributor Author

no rush! it's just on my vidtracker and i'm handling css requests separately for now

@paluh
Copy link
Collaborator

paluh commented Jul 15, 2018

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?

@owickstrom
Copy link
Collaborator

Looks like a good start @paluh. 👍 And yeah, let's make it a parameter when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants