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

wrap mime.TypeByExtension with preset mimetypes #206

Merged
merged 1 commit into from
Oct 23, 2019

Conversation

cocoastorm
Copy link
Contributor

Fixes #182

Not quite sure if this is the best fix. But I looked at the files under view and they seem to be .css, .html, .js, .png. The corresponding mimetypes are preset in a map[string]string var.

This seems to only happen on Windows, as the mimetypes are extracted from the registry as per Golang docs

If there's no preset mimetype, it calls mime.TypeByExtension under the hood.

If you believe there's a less obtrusive fix, please let me know!

Cheers!

@RadhiFadlillah RadhiFadlillah merged commit 9f7c8bf into go-shiori:master Oct 23, 2019
@RadhiFadlillah
Copy link
Collaborator

Yep, nicely done. Thanks !

@cocoastorm cocoastorm deleted the fix-js-mimetype branch October 24, 2019 22:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to load module script
2 participants