In Ruby on Rails you can place the access control headers in the Application Controller. What about Padrino? where do you place them? I've tried placing them in the method of a Controller I need to use different headers and inside app.rb, but it doesn't workout... any ideas?
Asked
Active
Viewed 513 times
0
-
Perhaps the answer to this question could help - http://stackoverflow.com/questions/4351904/sinatra-options-http-verb – Nikhil Apr 04 '13 at 00:13
1 Answers
0
As Nikhil mentioned it, setting the response headers yourself is a great way of doing it and being in control of what's happening.
If you put them on a before block in app.rb they will apply to the every route in your app which I guess is what you're trying to achieve here.
Just be careful on which permissions you grant. I find this MDN guide a great resource for CORS headers.

halfer
- 19,824
- 17
- 99
- 186

Darío Javier Cravero
- 1,692
- 13
- 9