Adding MIME definitions to Trinidad

266 views Asked by At

I'm using the trinidad gem to host my jruby application.

However, any requests for .woff or .ttf font files are met with 400 Bad Request.

When I was jar-ing up my project with warbler and dumping the jar file in a regular Tomcat instance, I was able to add the MIME type definitions for those extensions in the web.xml.

However, I do not know how to do this for the instance of Tomcat that the trinidad gem uses, and the documentation doesn't appear to list it. It does mention specifying a web.xml file to use as a default for the web applications, but that appears to be the one that's placed in the WEB-INF folder and the server doesn't start when I put in Tomcat's conf/web.xml file for it.

I've also tried adding the following lines to config/initializers/mime_types.rb:

Mime::Type.register "application/x-font-woff", :woff
Mime::Type.register "application/octet-stream", :ttf

but this doesn't appear to affect the public folder (and I'd be surprised if it did...).

Where can I find how to do this?

0

There are 0 answers