From 51fadf237ae43047be74d35744c3684582ee5a0d Mon Sep 17 00:00:00 2001 From: Wangchong Zhou Date: Mon, 2 Dec 2024 15:49:55 +0800 Subject: [PATCH] fix(ai-proxy): fix content-encoding for non 200 responses (cherry picked from commit 2cdafddf69cd3d3c56ef66d0a3ea3ab154cbd1f2) --- kong/llm/plugin/base.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kong/llm/plugin/base.lua b/kong/llm/plugin/base.lua index 4bafcecefb5a..c678ec43d0a5 100644 --- a/kong/llm/plugin/base.lua +++ b/kong/llm/plugin/base.lua @@ -113,6 +113,9 @@ function MetaPlugin:header_filter(sub_plugin, conf) -- for gzip response, don't set content-length at all to align with upstream kong.response.clear_header("Content-Length") kong.response.set_header("Content-Encoding", "gzip") + + else + kong.response.clear_header("Content-Encoding") end else