Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom headers needs documentation #289

Closed
bschaeffer opened this issue Jan 9, 2015 · 3 comments
Closed

Custom headers needs documentation #289

bschaeffer opened this issue Jan 9, 2015 · 3 comments

Comments

@bschaeffer
Copy link

How do custom headers work? I've only ever seen examples in two issues (#232 & #233) that we're never really closed and have basically no discussion so they didn't help

For instance, I'm using Rackspace and would like to set some Access-Control-* headers on my font assets, here's my custom_headers configuration:

config.custom_headers = {
  '.*\.(ttf|otf|eot|woff|svg|swf)$' => {
    access_control_allow_origin: '*',
    access_control_max_age: 1728000,
  }
}

.*\.(ttf|otf|eot|woff|svg|swf)$ looks like a pretty good regular expression to me, as all the examples I've seen seem to indicate that string/regex keys seem to be allowed.

But none of my font files are being uploaded, even after a rake assets:clean assets:clobber call.

@bschaeffer
Copy link
Author

Okay, so my example was bad. Needed double quotes " instead of single quotes as a key. Still think there needs to be some documentation on that end.

@embs
Copy link

embs commented May 25, 2016

I agree about the need for documentation. I couldn't find, for instance, how to configure custom headers through environment variable (nonetheless documentation proposition that any configuration is possible through env vars).

Is it possible to configure custom headers through environment variable?

@PikachuEXE
Copy link
Member

I don't think there is a way to config it through environment variable
Since it's a hash of a hash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants