Skip to content

Commit

Permalink
fix(ai-proxy)(general): body_filter should not run on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tysoekong committed Jul 9, 2024
1 parent bd30744 commit 7e282d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kong/plugins/ai-proxy/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ function _M:body_filter(conf)
return
end

-- only act on 200 in first release - pass the unmodifed response all the way through if any failure
if kong.response.get_status() ~= 200 then
return
end

local route_type = conf.route_type

if kong_ctx_shared.skip_response_transformer and (route_type ~= "preserve") then
Expand Down

0 comments on commit 7e282d4

Please sign in to comment.