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



##########
File path: apisix/plugins/cors.lua
##########
@@ -151,6 +152,17 @@ local function set_cors_headers(conf, ctx)
     end
 end
 
+local function get_match_domain(allow_origins, req_origin)
+    if allow_origins == req_origin or allow_origins == '*' then
+        return req_origin
+    else
+        local matched = re_find(req_origin, allow_origins, "jo")

Review comment:
       We need an extra configuration called `allow_origins_by_regex`. And this 
configuration should be an array. Please take a look at plugin uri-blocker.
   
   Most importantly, please add tests and docs. We can't accept a new feature 
without them.




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