So here is my code that causes issues with my form.
It seems to be the method I am setting the POST data. Everything else works fine but replacing the existing POST data with my `args` table causes form saving errors and if i remove ngx encode args it causes Lua errors. I seem to be stuck in a rock and a hard place I don't know how else to set the post data setting the un-needed args to nil can anyone see and show me what I am doing wrong please thank you so much <3.
--[[Lua Table POST Request arguments Guest users filter]]
ngx.req.read_body()
local args = ngx.req.get_post_args() or ""
if args["task"] == "get.like"
then
args["id"] = nil
args["task"] = "get.like" --because all have same response
end
ngx.req.set_body_data(ngx.encode_args(args)) --set the post data as our modified post data (causing errors....!?)
ngx.var.cache_request_body = ngx.var.request_body --For fastcgi and proxy cache KEY to cache post requests
--[[End Lua Table POST Request arguments Guest users filter]]