Hello guys,
How can i encode a json inside a envoyfilter?
function envoy_on_request(request_handle)
path = get_header(request_handle, ":path")
local host = get_header(request_handle, ":authority")
local auth_host = "dev-auth.services.svc.cluster.local"
local auth_path = "/api/v1/has-permission"
local cluster = "outbound|8080||" .. auth_host
local request_headers = {
[":method"] = "POST",
[":path"] = auth_path,
[":authority"] = auth_host,
["Content-Type"] = "application/json"
}
local jsonFile = {
["application"] = "APP",
["path"] = "/",
["method"] = "GET"
}
local request_body = json.encode(jsonFile)
This doesnt work, is there any special library?
Thanks