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/04/19 01:38:08 UTC

[GitHub] [apisix] sniper-xx edited a comment on issue #4074: request help: How to rewrite the data of backend server response?

sniper-xx edited a comment on issue #4074:
URL: https://github.com/apache/apisix/issues/4074#issuecomment-822111340


   @Firstsawyou The problem has resovled.  the reason is:
   for the large json response, the _M.body_filter will execute many times.  I store every  ngx.arg[1] to  variable backend_content, but the ngx.arg[1] not clear, so ,the final result is repeated. 
   solution:  
    ```lua
     if not isFinished then
         backend_content = backend_content..ngx.arg[1]
         ngx.arg[1] = nil -- have to clear ngx.arg[1]
     end
   ```
      


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