spacewander commented on a change in pull request #3839:
URL: https://github.com/apache/apisix/pull/3839#discussion_r597361954



##########
File path: apisix/plugins/cors.lua
##########
@@ -133,7 +157,7 @@ local function set_cors_headers(conf, ctx)
     end
 
     core.response.set_header("Access-Control-Allow-Origin", 
ctx.cors_allow_origins)
-    if ctx.cors_allow_origins ~= "*" then
+    if ctx.cors_allow_origins ~= "*" or conf.allow_origins_by_regex ~= nil then

Review comment:
       Yes. 
   
   >if allow_origins_by_regex is matched, the cors_allow_origins will be the 
matched domain. not *
   
   So `ctx.cors_allow_origins ~= "*"` will be true.
   Therefore there is no need to add an additional condition.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to