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



##########
File path: t/plugin/ua-restriction.t
##########
@@ -739,3 +739,51 @@ hello world
     }
 --- response_body
 passed
+
+
+
+=== TEST 33: the element in allowList is null
+--- config
+    location /t {
+        content_by_lua_block {
+            local plugin = require("apisix.plugins.ua-restriction")
+            local conf = {
+                allowlist = {
+                    null
+                },
+            }
+            local ok, err = plugin.check_schema(conf)
+            if not ok then
+                ngx.say(err)
+            end
+
+            ngx.say("done")
+        }
+    }
+--- response_body
+property "allowlist" validation failed: expect array to have at least 1 items

Review comment:
       Look like the conf is not rejected because of the bad regex? Maybe we 
need a wrong regex to test it.




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