batman-ezio commented on a change in pull request #3839:
URL: https://github.com/apache/apisix/pull/3839#discussion_r596511432



##########
File path: apisix/plugins/cors.lua
##########
@@ -179,8 +193,49 @@ function _M.header_filter(conf, ctx)
         end
     end
 
-    ctx.cors_allow_origins = allow_origins
-    set_cors_headers(conf, ctx)
+    return allow_origins
+end
+
+local function process_with_allow_origins_by_regex(conf, ctx)
+    if conf.allow_origins_by_regex == nil  or 
next(conf.allow_origins_by_regex) == nil then
+        return
+    end
+    local req_origin = core.request.header(ctx, "Origin")

Review comment:
       how to do that? lua  needs to set values into array, 
https://stackoverflow.com/questions/28502501/how-to-declare-an-array-with-x-elements-in-lua




----------------------------------------------------------------
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:
[email protected]


Reply via email to