Eslam3bdel3al commented on issue #127:
URL: 
https://github.com/apache/apisix-go-plugin-runner/issues/127#issuecomment-2223332773

   the `setBody([]byte)` sets the body correctly.
   
   the issue I faced related to the **content-length** header, as after setting 
the new body **APISIX** seems to send the original **content-length** to the 
upstream services when using both "ext-plugin-pre-req" and 
"ext-plugin-post-resp", and that leads to issues related to body parsing in 
some of these services (express app in my case).
   
   The issue get fixed by deleting the **'content-length'** header after 
setting the new body so it get calculated again to the new length.
   `r.SetBody(newbody)`
   `r.Header().Del("content-length")`


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