Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Rails 5.0.0 - Access-Control-Allow-Origin #125
I run rails 5.0 on heroku and i've followed all steps but the following error persists:
Postman's plugin results:
Important: I am connected by my company's proxy.
I d really thankfull if you @cyu can help me.
I also ran into several problems configuring cors, but in the end it was not rack-cors, but my configuration that was wrong. CORs configuration is difficult because it is precise; if Access-Control-Allow-Origin is not being returned it's because your request did not match your configuration /precisely/.
Looking at your config.ru, I can already guess your problem:
resource '/file/list_all/', :headers => 'x-domain-token' resource '/file/at/*', :methods => [:get, :post, :delete, :put, :patch, :options, :head], :headers => 'x-domain-token', :expose => ['Some-Custom-Response-Header'], :max_age => 600
First try setting
My suggested strategy: start from the absolutely most laxed settings (match all origins, match all headers, etc), and one by one make changes to the settings to restrict. When something doesn't work, you'll need you made a mistake when the request starts to fail.