X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=core%2Fcontrib%2Fwebuci_bootstrap.lua;h=9a2fafb0ef068b44e5990e4f4825ff2184aa49e9;hp=c8aa18ccafdbbc1b06a30db473ace4cdae87d5cd;hb=4264e6b7808066686223d0294bd01a84659f9f38;hpb=54d92ebab5f402409b26a28994ed9309e47c4b41 diff --git a/core/contrib/webuci_bootstrap.lua b/core/contrib/webuci_bootstrap.lua index c8aa18ccaf..9a2fafb0ef 100644 --- a/core/contrib/webuci_bootstrap.lua +++ b/core/contrib/webuci_bootstrap.lua @@ -3,18 +3,19 @@ package.cpath = "/usr/lib/lua/?.so;" .. package.cpath module("webuci", package.seeall) function prepare_req(uri) - REQUEST_URI = uri + env = {} + env.REQUEST_URI = uri require("ffluci.menu").get() end function init_req(context) - SERVER_PROTOCOL = context.server_proto - REMOTE_ADDR = context.remote_addr - REQUEST_METHOD = context.request_method - PATH_INFO = "/" .. context.uri - REMOTE_PORT = context.remote_port - SERVER_ADDR = context.server_addr - SCRIPT_NAME = REQUEST_URI:sub(1, #REQUEST_URI - #PATH_INFO) + env.SERVER_PROTOCOL = context.server_proto + env.REMOTE_ADDR = context.remote_addr + env.REQUEST_METHOD = context.request_method + env.PATH_INFO = "/" .. context.uri + env.REMOTE_PORT = context.remote_port + env.SERVER_ADDR = context.server_addr + env.SCRIPT_NAME = REQUEST_URI:sub(1, #REQUEST_URI - #PATH_INFO) end function handle_req(context)