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 2021/05/13 02:54:55 UTC

[GitHub] [apisix] vincentwc opened a new issue #4235: request help: use response-rewrite plugin to rewrite response body failed

vincentwc opened a new issue #4235:
URL: https://github.com/apache/apisix/issues/4235


   ### Issue description
    first, create route show as below:
   `{
       "desc": "my-product-demo-85",
           "labels":{
           "demo_env" : "prod",
           "prod_env" : "prod"
       },
       "uri": "/product/hello",
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "ip:8085": 1
           }
       }
   }`
   second: pacth a response-rewrite plugin toi this route:
   `{
       "plugins": {
               "response-rewrite": {
               "body": "{\"code\":\"ok\",\"message\":\"new json body\"}",
               "status_code" : 205,
               "headers": {
                   "X-Server-id": 3,
                   "X-Server-status": "on",
                   "Content-Type" : "multipart/form-data"
               }
   
           }
       }
   }`
   
   third: send request to the route:
   i find the header info has changed to response-rewrite info such as status_code,headers etc.
   but body info not changed, this si my body response: "hello product Controller"
    why ?
   
   
   ### Environment
   
   * apisix version (cmd: `apisix version`):
   * OS (cmd: `uname -a`):
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   * etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   * apisix-dashboard version, if have:
   * luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   


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



[GitHub] [apisix] spacewander closed issue #4235: request help: use response-rewrite plugin to rewrite response body failed

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #4235:
URL: https://github.com/apache/apisix/issues/4235


   


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



[GitHub] [apisix] spacewander commented on issue #4235: request help: use response-rewrite plugin to rewrite response body failed

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #4235:
URL: https://github.com/apache/apisix/issues/4235#issuecomment-840273429


   Please open a new one with **good configuration format** and **enough information**. You should make a good issue so others are able to help you. 


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



[GitHub] [apisix] spacewander commented on issue #4235: request help: use response-rewrite plugin to rewrite response body failed

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #4235:
URL: https://github.com/apache/apisix/issues/4235#issuecomment-840272321


   We can't help you if you don't even fill in the Environment info.
   And your example is in a very terrible format that I can't even understand your configuration.
   
   I can't understand such a configuration. Please reformat and add enough info.
   <img width="602" alt="微信截图_20210513114519" src="https://user-images.githubusercontent.com/4161644/118074561-c0957a80-b3e0-11eb-8f42-7e1ad2f15e78.png">
   


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