Skip to content

Commit

Permalink
HOTFIX: reflect origin headers to allow auth
Browse files Browse the repository at this point in the history
I broke remote authentication in e70230a. An upgrade to rack-cors changed the behavior of `origins '*'`
such that it now does not reflect the request's origin and instead actually sends '*' for the allowed origins header. That means authentication on our requests fails :(

See this change in rack-cors: cyu/rack-cors#142

We needed this behavior initially because it seemed like `Authorization` headers in our requests were getting stripped, but it seems like this may no longer be true. That needs more testing, though. For now, force rack-cors to return to its earlier behavior.

 Please enter the commit message for your changes. Lines starting
  • Loading branch information
Mr0grog committed Aug 20, 2017
1 parent f29b1a0 commit ad560ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Application < Rails::Application
end

allow do
origins '*'
origins /.*/
resource '*', :headers => :any, :methods => [:get, :post, :options], :if => is_admin_url
end
end
Expand Down

0 comments on commit ad560ad

Please sign in to comment.