postrank-labs/goliath

How to add CORS

biagiotumino opened this issue · 3 comments

Hello,

How to add CORS in rack config ?
I test use a gem https://github.com/cyu/rack-cors but he doesn't work.

Any idea ?

Thanks

The middleware must be "async friendly", see our docs here: https://github.com/postrank-labs/goliath/wiki/Middleware

[200, {"Content-Type"=>"application/json", "Access-Control-Allow-Origin" => "*"}, {response: "Hello"}]

There's middleware for CORS in my branch of goliath-contrib --

https://github.com/mrflip/goliath-contrib/blob/son_of_a_batch/lib/goliath/contrib/rack/cors_access_control.rb

flip

On Thu, Jan 31, 2013 at 10:04 AM, Maxime notifications@github.com wrote:

[200, {"Content-Type"=>"application/json", "Access-Control-Allow-Origin"
=> "*"}, {response: "Hello"}]


Reply to this email directly or view it on GitHubhttps://github.com//issues/227#issuecomment-12949480.