yehorkovalchuk777 commented on issue #10915:
URL: https://github.com/apache/apisix/issues/10915#issuecomment-1929074930

   > You can change the status of response in the `header_filter` phase. like 
this: `ngx.header.content_length = #your body's length` 
`ngx.header.content_encoding = nil ` `ngx.status = 400` `header_filter` must 
work with `body_filter` when you want to modify both header and body. It worked 
for me.
   
   I can change the response status only in the `header_filter` phase, but I 
want to change the status only when the response body is invalid. The following 
situation arises:
   In the `header_filter` phase, we can change the status of the response, but 
we cannot read and validate the response body and set the status based on the 
validation.
   In the `body_filter` phase, we can read and validate the response body, but 
we cannot change the response status.


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