okaybase commented on a change in pull request #4849:
URL: https://github.com/apache/apisix/pull/4849#discussion_r692070723
##########
File path: t/plugin/uri-blocker.t
##########
@@ -332,3 +332,130 @@ GET /hello?name=;union%20select%20
GET /hello?cc=2
--- no_error_log
[error]
+
+
+
+=== TEST 16: invalid rejected_msg length
+--- config
+location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+ local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+ "plugins": {
+ "uri-blocker": {
+ "block_rules": ["^a"],
+ "rejected_msg": ""
+ }
+ },
+ "uri": "/hello"
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ end
+ ngx.print(body)
+ }
+}
+--- request
+GET /t
+--- error_code: 400
+--- response_body
+{"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"}
+--- no_error_log
+[error]
+
+
+
+=== TEST 17: invalid rejected_msg type
Review comment:
okay, got, thanks~
--
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]