luci-base: uhttpd.lua: expose all CGI variables
authorJo-Philipp Wich <jo@mein.io>
Fri, 10 Apr 2020 19:03:19 +0000 (21:03 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 7 May 2020 17:40:49 +0000 (19:40 +0200)
Fixes: #3873
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 465891ff0239b8fdafb737d01e3f05205a14319b)

modules/luci-base/luasrc/sgi/uhttpd.lua

index 2836bf00cfb6780a7a01face8e0622f9255eb8d5..4cd3649c62d82ed3f323b01ca49b625a8cfb0ee1 100644 (file)
@@ -18,7 +18,17 @@ function handle_request(env)
                SCRIPT_NAME     = env.SCRIPT_NAME:gsub("/+$", ""),
                SCRIPT_FILENAME = env.SCRIPT_NAME,
                SERVER_PROTOCOL = env.SERVER_PROTOCOL,
-               QUERY_STRING    = env.QUERY_STRING
+               QUERY_STRING    = env.QUERY_STRING,
+               DOCUMENT_ROOT   = env.DOCUMENT_ROOT,
+               HTTPS           = env.HTTPS,
+               REDIRECT_STATUS = env.REDIRECT_STATUS,
+               REMOTE_ADDR     = env.REMOTE_ADDR,
+               REMOTE_NAME     = env.REMOTE_NAME,
+               REMOTE_PORT     = env.REMOTE_PORT,
+               REMOTE_USER     = env.REMOTE_USER,
+               SERVER_ADDR     = env.SERVER_ADDR,
+               SERVER_NAME     = env.SERVER_NAME,
+               SERVER_PORT     = env.SERVER_PORT
        }
 
        local k, v
@@ -44,7 +54,7 @@ function handle_request(env)
        local req = luci.http.Request(
                renv, recv, luci.ltn12.sink.file(io.stderr)
        )
-       
+
 
        local x = coroutine.create(luci.dispatcher.httpdispatch)
        local hcache = { }