nic-6443 commented on code in PR #14252:
URL: https://github.com/apache/apisix/pull/14252#discussion_r4676547108


##########
apisix/plugins/brotli.lua:
##########
@@ -241,10 +231,14 @@ function _M.header_filter(conf, ctx)
         core.response.add_header("Vary", "Accept-Encoding")
     end
 
-    local compressor = create_brotli_compressor(conf.mode, conf.comp_level,
-                                                conf.lgwin, conf.lgblock)
+    local compressor, err = lib.new_encoder({
+        mode = conf.mode,
+        quality = conf.comp_level,
+        lgwin = conf.lgwin,

Review Comment:
   Fixed in 08c7fb651a. The plugin now maps an explicit `lgwin=0` to the 
previous effective window of 10. The regression test checks the window encoded 
in the stream, which also catches a fallback to the native default of 22.



##########
apisix/plugins/response-rewrite.lua:
##########
@@ -272,11 +272,13 @@ function _M.body_filter(conf, ctx)
 
         local err
         if ctx.response_encoding ~= nil and body ~= "" then
-            local decoder = 
content_decode.dispatch_decoder(ctx.response_encoding)
+            local decoder, unavailable = 
content_decode.dispatch_decoder(ctx.response_encoding)
             if not decoder then
-                core.log.error("filters may not work as expected ",
-                               "due to unsupported compression encoding type: 
",
-                               ctx.response_encoding)
+                if not unavailable then

Review Comment:
   Fixed in 08c7fb651a. When the Brotli decoder is unavailable, 
response-rewrite detects it before clearing headers or buffering chunks. The 
new test sends two multi-chunk responses through the same worker and checks 
that both retain the original bytes and encoding. Explicit header and status 
changes and fixed-body replacement still work.



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