-
Notifications
You must be signed in to change notification settings - Fork 63
WOFF font files are not served with a correct MIME type (application/font-woff) #217
Comments
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
@MartinCerny does this fail for WOFF2 as well? |
I have not tested, but very likely not - the list of MIME types in https://github.com/elm-lang/elm-reactor/blob/master/src/backend/Main.hs (search for "mimeTypeDict") does not contain woff2. |
I have a similar issue, not sure if I should have better opened a separate one. I'm working on a parser for wavefront .obj files. (here) Elm reactor serves my <!DOCTYPE HTML>
<html><head><meta charset="UTF-8"><title>~/suzanne.obj</title><style type="text/css">@import url(http://fonts.googleapis.com/css?family=Source+Code+Pro);
html, head, body, pre {
margin: 0;
height: 100%;
}
body {
font-family: 'Source Code Pro', monospace;
}
</style><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/default.min.css"><script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script><script>if (hljs) { hljs.initHighlightingOnLoad(); }</script></head><body style="background-color: #F0F0F0;"><pre><code># Blender3D v249 OBJ File: suzanne.blend
# www.blender3d.org
v 0.437500 0.164063 0.765625
v -0.437500 0.164063 0.765625
v 0.500000 0.093750 0.687500
...
↪ file --mime-type suzanne.obj
suzanne.obj: text/plain As a workaround I'm currently using |
As WOFF fonts are (slightly) more widely supported by browsers then TTF fonts (see http://caniuse.com/#feat=woff versus http://caniuse.com/#feat=ttf) I wanted to use them in my app, but it turns out, elm-reactor won't serve them with the correct MIME type.
According to https://www.w3.org/TR/WOFF/#appendix-b the MIME type should be application/font-woff
The text was updated successfully, but these errors were encountered: