MonkeyDLufy commented on code in PR #10872:
URL: https://github.com/apache/apisix/pull/10872#discussion_r1470447467
##########
apisix/plugins/mocking.lua:
##########
@@ -229,6 +229,7 @@ function _M.access(conf, ctx)
if conf.response_headers then
for key, value in pairs(conf.response_headers) do
+ value = core.utils.resolve_var(value, ctx.var)
Review Comment:
I agree with @smileby .
I have reviewed all the codes, `resolve_var` never check nil, and it can
work without error.
when the `value` is nil, this header will be ignored as @smileby say.
It work the same as nginx `add_header`, I think it is ok
--
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]