mscb402 commented on code in PR #8336:
URL: https://github.com/apache/apisix/pull/8336#discussion_r1024708671
##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -150,13 +220,69 @@ do
core.table.insert(upstream_names, name)
end
-function _M.rewrite(conf, ctx)
- for _, name in ipairs(upstream_names) do
- if conf[name] then
- ctx.var[upstream_vars[name]] = conf[name]
+ local function create_header_operation(hdr_conf)
+ local set = {}
+ local add = {}
+
+ if is_new_headers_conf(hdr_conf) then
+ if hdr_conf.add then
+ for field, value in pairs(hdr_conf.add) do
+ core.table.insert_tail(add, field, value)
+ end
+ end
+ if hdr_conf.set then
+ for field, value in pairs(hdr_conf.set) do
+ core.table.insert_tail(set, field, value)
+ end
+ end
+
+ else
+ for field, value in pairs(hdr_conf) do
+ core.table.insert_tail(set, field, value)
+ end
end
+
+ return {
+ add = add,
+ set = set,
+ remove = hdr_conf.remove or {},
+ }
end
+ local function addHeader(ctx, header_name, header_value)
Review Comment:
done
--
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]