Revolyssup commented on code in PR #9710:
URL: https://github.com/apache/apisix/pull/9710#discussion_r1266338198
##########
apisix/plugins/opa.lua:
##########
@@ -125,6 +133,18 @@ function _M.access(conf, ctx)
end
return status_code, reason
+ else if result.headers and #conf.send_headers_upstream > 0 then
+ local headersToSend = {}
+ for key in pairs(conf.send_headers_upstream) do
+ headersToSend[key] = true
+ end
+ for key,value in pairs(result.headers) do
+ if headersToSend[key] then
+ core.request.set_header(ctx,key,value)
+ end
+
+ end
+ end
Review Comment:
done
##########
apisix/plugins/opa.lua:
##########
@@ -37,6 +37,14 @@ local schema = {
description = "timeout in milliseconds",
},
keepalive = {type = "boolean", default = true},
+ send_headers_upstream = {
+ type = "array",
+ minItems = 0,
+ items = {
+ type = "string"
+ },
+ description = "list of headers to pass to upstream in request"
+ },
Review Comment:
done
##########
apisix/plugins/opa.lua:
##########
@@ -20,6 +20,7 @@ local http = require("resty.http")
local helper = require("apisix.plugins.opa.helper")
local type = type
+local pairs = pairs
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]