sihyeonn commented on code in PR #13098:
URL: https://github.com/apache/apisix/pull/13098#discussion_r2957542796
##########
apisix/plugins/gzip.lua:
##########
@@ -161,6 +161,8 @@ function _M.header_filter(conf, ctx)
return
end
+ ctx.gzip_set = true
+
Review Comment:
Good catch — added a Content-Encoding guard (same pattern as brotli) so we
skip gzip when upstream already compressed the response. Fixed in the latest
push.
##########
apisix/utils/log-util.lua:
##########
@@ -374,7 +374,7 @@ function _M.collect_body(conf, ctx)
end
local response_encoding = ngx_header["Content-Encoding"]
- if not response_encoding then
+ if not response_encoding or ctx.gzip_set then
ctx.resp_body = final_body
return
Review Comment:
Makes sense, added a test case with gzip plugin + file-logger with
include_resp_body enabled. Also added a test for the upstream Content-Encoding
guard.
--
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]