Production enviroment issue
I'm kind of at loss how this is supposed to work in production environments. Static assets are supposed to be served directly by the webserver (apache/nginx), instead of passing through Rails. This means that the middleware will not kick in and the headers would not be set. Am I missing something here?
Our assets are served by the Rails app because we are on Heroku's cedar stack. Our CDN makes the requests for the asset, and we want that asset to be served with correct Access-Control headers from the CDN. Thus, this middleware.
Gotcha, in this case it makes sense. So when i'm serving assets via my web server, i just need to handle adding those headers in there. Thanks a bunch.
Looks like this issue can be closed. =)