Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy/cors: stop setting headers twice in preflight reqs #570

Merged
merged 1 commit into from
Feb 1, 2018

Conversation

davidor
Copy link
Contributor

@davidor davidor commented Feb 1, 2018

This PR introduces a minor improvement in the CORS policy.
In the case of a preflight request, we were setting the CORS headers twice. This PR fixes that.

Thanks @mayorova for reporting.

@davidor davidor requested review from mayorova and mikz February 1, 2018 15:42
@davidor davidor force-pushed the set-headers-once-in-cors-preflight branch from ade448b to c3d9efc Compare February 1, 2018 15:50
@@ -72,9 +72,9 @@ local function is_cors_preflight()
ngx.var.http_access_control_request_method
end

function _M:rewrite()
function _M.rewrite(_)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this so codeclimate does not complain about unused self.

@davidor davidor merged commit 91a2882 into master Feb 1, 2018
@davidor davidor deleted the set-headers-once-in-cors-preflight branch February 1, 2018 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants