monkeyDluffy6017 commented on code in PR #9710:
URL: https://github.com/apache/apisix/pull/9710#discussion_r1266353227
##########
apisix/plugins/opa.lua:
##########
@@ -125,6 +134,18 @@ function _M.access(conf, ctx)
end
return status_code, reason
+ else if result.headers and conf.send_headers_upstream 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)
Review Comment:
I think you could refactor this block like this:
```
for key, _ in pairs(conf.send_headers_upstream) do
if result.headers[key] then
core.request.set_header(ctx, key, value)
end
end
```
--
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]