sstephenson/sprockets — Issue #296: Mime type for .ttf not working
Author: mattheworiordan
Created: 2012-02-17 10:38:57+00:00
State: open

I am using a sass-rails helper ```asset-data-url('my-font.ttf')``` that when looking at the code is calling Sprocket's ```context.asset_data_uri(path)``` and is generating the following style sheet data:

url(data:application/octet-stream;base64,AAEAAAASAQAABAAgRkZ.....)

Looking into your code, it appears that you use ```Rack::Mime::MIME_TYPES``` so I have manually registered the .ttf extension as follows: ```Rack::Mime::MIME_TYPES[".ttf"] = "font/truetype"```

However, regardless of what I do, for some reason asset_data_uri keeps defaulting to application/octet-stream.

Do you have any idea why that may be?

Matt