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



##########
File path: t/plugin/uri-blocker.t
##########
@@ -332,3 +332,39 @@ GET /hello?name=;union%20select%20
 GET /hello?cc=2
 --- no_error_log
 [error]
+
+
+
+=== TEST 16: invalid rejected_msg length or type
+--- config
+location /t {
+    content_by_lua_block {
+        local data = {
+            {
+                input = 
[[{"plugins":{"uri-blocker":{"block_rules":["^a"],"rejected_msg":""}},"uri":"/hello"}]],
+                output = [[{"error_msg":"failed to check the configuration of 
plugin uri-blocker err: property \"rejected_msg\" validation failed: string too 
short, expected at least 1, got 0"}]]
+            },
+            {
+                input = 
[[{"plugins":{"uri-blocker":{"block_rules":["^a"],"rejected_msg":true}},"uri":"/hello"}]],
+                output = [[{"error_msg":"failed to check the configuration of 
plugin uri-blocker err: property \"rejected_msg\" validation failed: wrong 
type: expected string, got boolean"}]]

Review comment:
       Could you change them to tables instead of long strings?




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