Let's say I am setting a flag in access_by_lua and accessing it body_filter_by_lua like below-
location / {
access_by_lua '
ngx.ctx.flag = 1
';
body_filter_by_lua '
if ngx.ctx.flag ==1 then
-- do processing here
end
'
}
Is it guaranteed that if condition will in body_filter_by_lua will evaluate to true only for the requests where ngx.ctx.flag is 1?