Set Permissive CORS headers using this special rack middleware. This might solve your problem with broken fonts on firefox, and overly polite Ajax queries.
Add this line to your application's Gemfile:
gem 'rack-permissive-cors', git: "[email protected]:jackpine/rack-permissive-cors.git"
And then execute:
$ bundle
E.g you can force permissive CORS headers on all requests in case your CDN cache doesn't vary on Origin. I'm looking at you Cloudfront!
In config/environments/production.rb:
# Make sure to insert this middleware before `ActionDispatch::Static`
require 'rack/permissive-cors'
config.middleware.insert_before(ActionDispatch::Static,
Rack::PermissiveCors)
# serve your static assets using rails.
config.serve_static_assets = true
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request