Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FileServer: add simple content type detection #59

Merged
merged 2 commits into from
Jun 1, 2018

Conversation

paluh
Copy link
Collaborator

@paluh paluh commented May 31, 2018

Sets content type based on file extension predefined in static map in FileServer.purs.

@paluh
Copy link
Collaborator Author

paluh commented May 31, 2018

This PR slightly extends behavior of FileServer. It introduces mapping between file extension and ContentType header value. Mapping was taken from:

https://www.askapache.com/htaccess/

and

https://htaccess.wordpress.com/2008/07/16/sending-correct-content-type-headers-with-htaccess/

Merge?

@paluh
Copy link
Collaborator Author

paluh commented May 31, 2018

I can also use your suggestion from #57 and add this content type mapping as a parameter to server options record (together with userProvidedHeaders from this other PR). What do you think?

@owickstrom
Copy link
Collaborator

Looks good @paluh ! I say merge this, and then do the header user function separately. 👍

@paluh
Copy link
Collaborator Author

paluh commented Jun 1, 2018

Thanks!

@paluh paluh closed this Jun 1, 2018
@paluh paluh reopened this Jun 1, 2018
@paluh paluh merged commit 8790d49 into purescript-hyper:master Jun 1, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants