Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

WOFF font files are not served with a correct MIME type (application/font-woff) #217

Open
martinmodrak opened this issue Nov 22, 2016 · 4 comments

Comments

@martinmodrak
Copy link

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

@process-bot
Copy link

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.

@toastal
Copy link

toastal commented Nov 30, 2016

@MartinCerny does this fail for WOFF2 as well?

@martinmodrak
Copy link
Author

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.

@Zinggi
Copy link

Zinggi commented Dec 19, 2016

I have a similar issue, not sure if I should have better opened a separate one.
It's also a problem with the mime type.

I'm working on a parser for wavefront .obj files. (here)

Elm reactor serves my .obj files as text/html instead of text/plain.
It also adds some additional unwanted syntax highlighting code to it: This is the output from elm reactor:

<!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 tells me it's text/plain:

↪ file --mime-type suzanne.obj 
suzanne.obj: text/plain

As a workaround I'm currently using python -m http.server.
But I miss elm reactor 😢

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

No branches or pull requests

4 participants