Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add rewrite:RespHeaders and modify the upstream response headers via request implementation #6426

Merged
merged 10 commits into from
Mar 4, 2022
8 changes: 8 additions & 0 deletions apisix/plugins/ext-plugin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,14 @@ local rpc_handlers = {
end
end

local len = rewrite:RespHeadersLength()
rampagecong marked this conversation as resolved.
Show resolved Hide resolved
if len > 0 then
for i = 1, len do
local entry = rewrite:RespHeaders(i)
core.response.set_header(entry:Name(), entry:Value())
end
end

local len = rewrite:ArgsLength()
if len > 0 then
local changed = {}
Expand Down
2 changes: 1 addition & 1 deletion rockspec/apisix-master-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies = {
"luasec = 0.9-1",
"lua-resty-consul = 0.3-2",
"penlight = 1.9.2-1",
"ext-plugin-proto = 0.3.0",
"ext-plugin-proto = 0.4.0",
"casbin = 1.26.0",
"api7-snowflake = 2.0-1",
"inspect == 3.1.1",
Expand Down