some upstream fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Samuel Philipp 2021-03-19 20:33:40 +01:00
parent 42fca1fc41
commit 9c397a195e
Signed by: samuel-p
GPG key ID: 2AD495D17760CB4E

View file

@ -24,13 +24,12 @@ server {
location /UP {
access_by_lua_block{
local json = require("cjson")
ngx.req.read_body()
local req = ngx.req.get_body_data()
local newreq, n, err = ngx.re.gsub(req, '\\\\', '\\\\')
local newreq, n, err = ngx.re.gsub(newreq, '"', '\\"')
local newreq, n, err = ngx.re.gsub(newreq, "^", "{\"message\":\"")
local newreq, n, err = ngx.re.gsub(newreq, "$", "\"}")
ngx.req.set_body_data(newreq)
local newreq = { ["message"] = req }
local body = json.encode(newreq)
ngx.req.set_body_data(body)
}
proxy_set_header Content-Type application/json;