monkeyDluffy6017 commented on code in PR #9365:
URL: https://github.com/apache/apisix/pull/9365#discussion_r1401801007
##########
apisix/plugins/cors.lua:
##########
@@ -292,22 +346,44 @@ function _M.header_filter(conf, ctx)
-- If allow_origins_by_regex is not nil, should be matched to it only
local allow_origins
if conf.allow_origins_by_regex == nil then
- allow_origins = process_with_allow_origins(conf.allow_origins, ctx,
req_origin)
+ allow_origins = process_with_allow_origins(
+ TYPE_ACCESS_CONTROL_ALLOW_ORIGIN, conf.allow_origins, ctx,
req_origin
+ )
else
- allow_origins = process_with_allow_origins_by_regex(conf, ctx,
req_origin)
+ allow_origins = process_with_allow_origins_by_regex(
+ TYPE_ACCESS_CONTROL_ALLOW_ORIGIN, conf.allow_origins_by_regex,
+ conf, ctx, req_origin
+ )
end
if not match_origins(req_origin, allow_origins) then
allow_origins = process_with_allow_origins_by_metadata(
- conf.allow_origins_by_metadata, ctx, req_origin
+ TYPE_ACCESS_CONTROL_ALLOW_ORIGIN, conf.allow_origins_by_metadata,
ctx, req_origin
)
end
if conf.allow_origins ~= "*" then
core.response.add_header("Vary", "Origin")
end
- if allow_origins then
+ if allow_origins then
Review Comment:
remove redundant indents
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]