I have a Phoenix app, that should serve its static assets (fonts, mainly) to both www.domain.com
and subdomain.domain.com
.
The app is hosted on heroku.
How can I set up CORS headers?
I found this library, but it doesn't seems to work on static assets (I think).
I tried to configure it like this:
defmodule MyApp.CORS do
use Corsica.Router
resource "/fonts/*", origins: ["http://subdomain.domain.com"]
end
but the resulting headers are:
cache-control:public
content-length:839
content-type:image/svg+xml
date:Sun, 19 Jun 2016 09:40:01 GMT
etag:3AAE04D
server:Cowboy