-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Conversation
0553daf
to
e189da1
Compare
👍 |
kong/plugins/cors/handler.lua
Outdated
"jo") | ||
if err then | ||
ngx.log(ngx.ERR, "[cors] could not search for domain: ", err) | ||
return |
There was a problem hiding this comment.
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
kong/plugins/cors/handler.lua
Outdated
return | ||
end | ||
|
||
local req_origin = req_get_headers()["origin"] |
There was a problem hiding this comment.
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
Also looks like the rockspec is missing the migrations files. |
Indeed! That's missing from the rockspec tests... |
Removing approval- rockspec should be updated to include migrations files so unit tests pass
e189da1
to
34499de
Compare
Updated . |
34499de
to
eb3136b
Compare
eb3136b
to
f9cf0a9
Compare
f9cf0a9
to
574cc69
Compare
* 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
574cc69
to
76d0f12
Compare
Guys, cannot wait to use it already, just cut the right time since we are extending our web services. |
Summary
Updated PR to handle multiple origins in the CORS plugin.
Full changelog
origin
toorigins
, which allows a list of origins*
being configured forconf.origins
andAllow-Credentials
Issues resolved
Replace #1774
Replace #1973
Fix #1043
TODO