diff --git a/kong/llm/plugin/shared-filters/normalize-response-header.lua b/kong/llm/plugin/shared-filters/normalize-response-header.lua index 3ab240a1527..3420f5328c5 100644 --- a/kong/llm/plugin/shared-filters/normalize-response-header.lua +++ b/kong/llm/plugin/shared-filters/normalize-response-header.lua @@ -32,7 +32,7 @@ function _M:run(_) else kong.response.clear_header("Content-Encoding") end - else + elseif not get_global_ctx("response_body_sent") then kong.response.clear_header("Content-Encoding") end return true