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

feat(cors) allow for multiple origins #2203

Merged
merged 2 commits into from
Mar 15, 2017
Merged

Conversation

thibaultcha
Copy link
Member

@thibaultcha thibaultcha commented Mar 14, 2017

Summary

Updated PR to handle multiple origins in the CORS plugin.

Full changelog

Issues resolved

Replace #1774
Replace #1973
Fix #1043

TODO

@thibaultcha thibaultcha changed the title Feat/cors multiple origins feat/(cors) allow for multiple origins Mar 14, 2017
@nijikokun
Copy link
Contributor

👍

p0pr0ck5
p0pr0ck5 previously approved these changes Mar 14, 2017
"jo")
if err then
ngx.log(ngx.ERR, "[cors] could not search for domain: ", err)
return
Copy link
Contributor

Choose a reason for hiding this comment

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

strictly speaking, this return here seems unnecessary- even if one regex call failed, perhaps others could succeed

return
end

local req_origin = req_get_headers()["origin"]
Copy link
Contributor

Choose a reason for hiding this comment

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

using ngx.var as opposed to get_headers would possibly be more performant here

@p0pr0ck5
Copy link
Contributor

Also looks like the rockspec is missing the migrations files.

@thibaultcha
Copy link
Member Author

Indeed! That's missing from the rockspec tests...

@p0pr0ck5 p0pr0ck5 dismissed their stale review March 14, 2017 21:34

Removing approval- rockspec should be updated to include migrations files so unit tests pass

@thibaultcha
Copy link
Member Author

Updated .

@thibaultcha thibaultcha changed the title feat/(cors) allow for multiple origins feat(cors) allow for multiple origins Mar 14, 2017
@thibaultcha thibaultcha changed the base branch from master to next March 15, 2017 19:23
* renamed `origin` field to `origins`
* provide migrations for datastore
* use PCRE API for multiple origin matching
* fix compatibility with current upstream changes ensuring "*" support
* minor style updates
* minor perf updates
@thibaultcha thibaultcha added pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release) and removed pr/status/needs review labels Mar 15, 2017
@thibaultcha thibaultcha merged commit d9f752b into next Mar 15, 2017
@thibaultcha thibaultcha deleted the feat/cors-multiple-origins branch March 15, 2017 21:32
@wenqingyu
Copy link

Guys, cannot wait to use it already, just cut the right time since we are extending our web services.

@subnetmarco subnetmarco restored the feat/cors-multiple-origins branch March 21, 2017 04:22
@subnetmarco subnetmarco deleted the feat/cors-multiple-origins branch March 21, 2017 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/ready (but hold merge) No more concerns, but do not merge yet (probably a conflict of interest with another PR or release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants