spacewander commented on code in PR #9010:
URL: https://github.com/apache/apisix/pull/9010#discussion_r1127313637


##########
apisix/plugins/cors.lua:
##########
@@ -178,6 +179,9 @@ function _M.check_schema(conf, schema_type)
             end
         end
     end
+    if conf.allow_origins == "" and (not conf.allow_origins_by_regex or 
next(conf.allow_origins_by_regex) == nil) then

Review Comment:
   As allow_origins_by_regex is an array, we can use `#` to check if it's empty



##########
apisix/plugins/cors.lua:
##########
@@ -37,7 +38,7 @@ local metadata_schema = {
             type = "object",
             additionalProperties = {
                 type = "string",
-                pattern = origins_pattern
+                pattern = origins_metadata_pattern

Review Comment:
   Why change this pattern?



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

Reply via email to