On 07 Dec 2009, at 03:45, CoolAJ86 wrote:
> I would like to change the default headers which are sent out to
> include these CORS headers:
>
> Access-Control-Allow-Origin: *
> Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS
> Access-Control-Allow-Headers: X-PINGOTHER
> Content-Type: application/json; charset=UTF-8
>
> Could someone tell me where it is that I specify this?
Assuming that you are on Rails 2.3 or higher, I would use a rack
middleware for that. You have an example at
http://www.hokstad.com/rewriting-content-types-with-rack.html
Keep in mind that the Rack config file in Rails is replaced by adding
the rack middleware to environment.rb instead with:
config.middleware.use NameOfMiddleWareClass
Best regards
Peter De Berdt
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.