From af754e596a8dbb05ed8580c342e7fe02e08b28e0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 16:11:00 +0200 Subject: Adding upstream version 3.2.3+dfsg. Signed-off-by: Daniel Baumann --- scripts/ci/openresty/post-api.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/ci/openresty/post-api.lua (limited to 'scripts/ci/openresty/post-api.lua') diff --git a/scripts/ci/openresty/post-api.lua b/scripts/ci/openresty/post-api.lua new file mode 100644 index 0000000..3f22960 --- /dev/null +++ b/scripts/ci/openresty/post-api.lua @@ -0,0 +1,19 @@ +-- Simple API for checking POST data + +-- Get the request path +local reqPath = ngx.var.uri +-- Get the request method (POST, GET etc..) +local reqMethod = ngx.var.request_method +-- Get any URI arguments +local uriArgs = ngx.req.get_uri_args() +-- Get any POST arguments +ngx.req.read_body() +local postArgs = ngx.req.get_post_args() + +-- We only reply to POST requests +if reqMethod ~= "POST" +then + return false +end + +ngx.say("Section: ", uriArgs.section, ", User: ", postArgs.user) -- cgit v1.2.3