You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/13 01:55:47 UTC

[GitHub] [apisix] juzhiyuan commented on a change in pull request #2732: docs: add Attention message for 'response-rewrite' doc.

juzhiyuan commented on a change in pull request #2732:
URL: https://github.com/apache/apisix/pull/2732#discussion_r522558807



##########
File path: doc/plugins/response-rewrite.md
##########
@@ -116,3 +117,11 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f1
 ```
 
 The `response rewrite` plugin has been disabled now. It works for other plugins.
+
+## Attention
+
+`ngx.exit` will interrupt the execution of the current request and return status code to Nginx.
+
+![](https://cdn.jsdelivr.net/gh/Miss-you/img/picgo/20201113010623.png)
+
+However, if you execute `ngx.exit` during the access phase, it only interrupts the request processing phase, and the response phase will still process it, i.e. if you configure the `response-rerite` plugin, it will force overwriting of your response information (e.g. response code).

Review comment:
       Please check the plugin name 

##########
File path: doc/plugins/response-rewrite.md
##########
@@ -116,3 +117,11 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f1
 ```
 
 The `response rewrite` plugin has been disabled now. It works for other plugins.
+
+## Attention
+
+`ngx.exit` will interrupt the execution of the current request and return status code to Nginx.
+
+![](https://cdn.jsdelivr.net/gh/Miss-you/img/picgo/20201113010623.png)

Review comment:
       Not sure if this image link is stable, could we put it in the images folder?

##########
File path: doc/plugins/response-rewrite.md
##########
@@ -116,3 +117,11 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f1
 ```
 
 The `response rewrite` plugin has been disabled now. It works for other plugins.
+
+## Attention
+
+`ngx.exit` will interrupt the execution of the current request and return status code to Nginx.
+
+![](https://cdn.jsdelivr.net/gh/Miss-you/img/picgo/20201113010623.png)
+
+However, if you execute `ngx.exit` during the access phase, it only interrupts the request processing phase, and the response phase will still process it, i.e. if you configure the `response-rerite` plugin, it will force overwriting of your response information (e.g. response code).

Review comment:
       Not sure if response code is the same as response status code.

##########
File path: doc/zh-cn/plugins/response-rewrite.md
##########
@@ -19,12 +19,21 @@
 
 - [English](../../plugins/response-rewrite.md)
 
-# response-rewrite
+# 目录
+
+- [**response-rewrite**](#response-rewrite)
+- [**配置参数**](#配置参数)
+- [**开启插件**](#开启插件)
+- [**测试插件**](#测试插件)
+- [**禁用插件**](#禁用插件)
+- [**注意事项**](#注意事项)
+
+## response-rewrite
 
 该插件支持修改上游服务返回的 body 和 header 信息。
 
 使用场景:
-1、可以设置 `Access-Control-Allow-*` 等 header 信息,来实现 CORS (跨域资源共享)的功能。
+1、可以设置 `Access-Control-Allow-*` 等 header 信息,来实现 CORS (跨域资源共享)的功能。

Review comment:
       Two spaces?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org