Last active
August 29, 2015 13:56
-
-
Save joshwlewis/9336402 to your computer and use it in GitHub Desktop.
Rack::Cors doesn't insert headers when Rails app errors out. Fix it by inserting Rack::Cors at the top of your middleware stack.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.middleware.insert 0, Rack::Cors do | |
allow do | |
origins(/^https:\/\/app.client.com$/) | |
resource '*', | |
headers: :any, | |
methods: [:get, :put, :post, :delete] | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
May solve your issues that look like this: