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

Use Crystal MIME registry #516

Merged
merged 2 commits into from
Feb 5, 2019
Merged

Conversation

Sija
Copy link
Contributor

@Sija Sija commented Feb 5, 2019

Thanks to crystal-lang/crystal#5765 we can use MIME registry freshly built-in into Crystal stdlib.

If the system the app is run on is lacking MIME database there's a need to manually register following types to keep BC with previous Kemal version (since they're missing from MIME::DEFAULT_TYPES):

MIME.register ".ico", "image/x-icon"
MIME.register ".otf", "application/font-sfnt"
MIME.register ".ttf", "application/font-sfnt"
MIME.register ".woff", "application/font-woff"
MIME.register ".woff2", "font/woff2"
MIME.register ".mp4", "video/mp4"
MIME.register ".webm", "video/webm"

shard.yml Outdated Show resolved Hide resolved
shard.yml Show resolved Hide resolved
Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Could you please open a follow-up PR to https://github.com/kemalcr/kemalcr.com docs for adding custom Mime::Registry types. That'd be awesome 👍

@Sija
Copy link
Contributor Author

Sija commented Feb 5, 2019

@sdogruyol Sure! Could you point me please in the direction where exactly should I add it?

@sdogruyol
Copy link
Member

@Sija adding it under Helpers in https://github.com/kemalcr/kemalcr.com/blob/master/guide.md would be 👌

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

Successfully merging this pull request may close these issues.

2 participants