hf400159 commented on code in PR #7400:
URL: https://github.com/apache/apisix/pull/7400#discussion_r915384421


##########
docs/zh/latest/plugins/uri-blocker.md:
##########
@@ -58,35 +63,36 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335
 
 ## 测试插件
 
-```shell
-$ curl -i http://127.0.0.1:9080/root.exe?a=a
-HTTP/1.1 403 Forbidden
-Date: Wed, 17 Jun 2020 13:55:41 GMT
-Content-Type: text/html; charset=utf-8
-Content-Length: 150
-Connection: keep-alive
-Server: APISIX web server
+启用并配置插件后,使用 curl 命令尝试访问 `block_rules` 中指定文件的 URI:

Review Comment:
   ```suggestion
   启用并配置插件后,使用 `curl` 命令尝试访问 `block_rules` 中指定文件的 URI:
   ```



##########
docs/zh/latest/plugins/uri-blocker.md:
##########
@@ -23,20 +28,20 @@ title: uri-blocker
 
 ## 描述
 
-该插件可帮助我们拦截用户请求,只需要指定 `block_rules` 即可。
+`uri-blocker` 插件通过指定一系列 `block_rules` 来拦截用户请求。
 
 ## 属性
 
 | 名称          | 类型          | 必选项 | 默认值 | 有效值     | 描述                         
                                       |
 | ------------- | ------------- | ------ | ------ | ---------- | 
------------------------------------------------------------------- |
-| block_rules   | array[string] | 必须   |        |            | 
正则过滤数组。它们都是正则规则,如果当前请求 URI 命中任何一个,请将响应代码设置为 rejected_code 
以退出当前用户请求。例如:`["root.exe", "root.m+"]`。 |
-| rejected_code | integer       | 可选   | 403    | [200, ...] | 当请求 URI 命中 
`block_rules` 中的任何一个时,将返回的 HTTP 状态代码。 |
-| rejected_msg | string       | 可选    |      | 非空 | 当请求 URI 命中 `block_rules` 
中的任何一个时,将返回的 HTTP 响应体。 |
-| case_insensitive | boolean       | 可选    | false     |  | 是否忽略大小写。当值为 true 
时,在匹配请求 URI 时将忽略大小写。默认值是 false 。 |
+| block_rules   | array[string] | 是   |        |            | 
正则过滤数组。它们都是正则规则,如果当前请求 URI 命中其中任何一个,则将响应代码设置为 `rejected_code` 
以退出当前用户请求。例如:`["root.exe", "root.m+"]`。 |
+| rejected_code | integer       | 否   | 403    | [200, ...] | 当请求 URI 命中 
`block_rules` 中的任何一个时,将返回的 HTTP 状态代码。 |
+| rejected_msg | string       | 否    |      | 非空 | 当请求 URI 命中 `block_rules` 
中的任何一个时,将返回的 HTTP 响应体。 |
+| case_insensitive | boolean       | 否    | false     |  | 是否忽略大小写。当值为 `true` 
时,在匹配请求 URI 时将忽略大小写。 |

Review Comment:
   ```suggestion
   | case_insensitive | boolean       | 否    | false     |  | 是否忽略大小写。当设置为 
`true` 时,在匹配请求 URI 时将忽略大小写。 |
   ```



##########
docs/zh/latest/plugins/uri-blocker.md:
##########
@@ -58,35 +63,36 @@ curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335
 
 ## 测试插件
 
-```shell
-$ curl -i http://127.0.0.1:9080/root.exe?a=a
-HTTP/1.1 403 Forbidden
-Date: Wed, 17 Jun 2020 13:55:41 GMT
-Content-Type: text/html; charset=utf-8
-Content-Length: 150
-Connection: keep-alive
-Server: APISIX web server
+启用并配置插件后,使用 curl 命令尝试访问 `block_rules` 中指定文件的 URI:
 
-... ...
+```shell
+curl -i http://127.0.0.1:9080/root.exe?a=a
 ```
 
-如果你设置了属性 `rejected_msg` 的值为 `"access is not allowed"` ,将会收到如下的响应体:
+如果发现返回了带有 403 状态码的 HTTP 响应头,则代表插件生效:
 
 ```shell
-$ curl -i http://127.0.0.1:9080/root.exe?a=a
+...

Review Comment:
   ```suggestion
   ```



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