No commit activity in last 3 years
No release in over 3 years
Set access control headers for FF
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

Access Control Headers

Ever tried to serve custom font files from a cdn or similar? Doesn't work too well in Firefox does it...

This middleware is designed to set the required headers for a cdn to cache, meaning you can leave your nginx conf alone.

Works well on heroku with cloudfront in front.

Install

Add this to your applications Gemfile:

gem 'rack-access-control-headers'

And run:

$ bundle

Usage

In config/application.rb (or specific environment file):

config.middleware.insert_before 'ActionDispatch::Static', 'Rack::AccessControlHeaders', /assets/

Where /assets/ is a regex of the path you want to inject the headers.

N.b. including ahead of ActionDispatch::Static is important if you're running rails.