We serve some web fonts (.woff) from our static assets and I would like to set the correct mime type (application/x-font-woff
). I tried to do this in config/initializers/mime_types.rb
but it had no effect:
Mime::Type.register "application/x-font-woff", :woff
The returned mime type still stayed application/octet-stream
. I even tried to add this line (because it was the only other place in the rails source where I could find the string "woff"
):
Rack::Mime::MIME_TYPES[".woff"] = "application/x-font-woff"
But it still didn't help. How do I properly set the mime type for web fonts?