projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a77f1b9
)
Reintroduce prefisx support - was gone somewhere
author
Steven Barth
<steven@midlink.org>
Sat, 25 Jul 2009 12:45:38 +0000
(12:45 +0000)
committer
Steven Barth
<steven@midlink.org>
Sat, 25 Jul 2009 12:45:38 +0000
(12:45 +0000)
libs/web/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index
01cc109
..
a375eec
100644
(file)
--- a/
libs/web/luasrc/dispatcher.lua
+++ b/
libs/web/luasrc/dispatcher.lua
@@
-108,13
+108,21
@@
end
--- Dispatch an HTTP request.
-- @param request LuCI HTTP Request object
--- Dispatch an HTTP request.
-- @param request LuCI HTTP Request object
-function httpdispatch(request)
+function httpdispatch(request
, prefix
)
luci.http.context.request = request
luci.http.context.request = request
- context.request = {}
+
+ local r = {}
+ context.request = r
local pathinfo = http.urldecode(request:getenv("PATH_INFO") or "", true)
local pathinfo = http.urldecode(request:getenv("PATH_INFO") or "", true)
+ if prefix then
+ for _, node in ipairs(prefix) do
+ r[#r+1] = node
+ end
+ end
+
for node in pathinfo:gmatch("[^/]+") do
for node in pathinfo:gmatch("[^/]+") do
- table.insert(context.request, node)
+ r[#r+1] = node
end
local stat, err = util.coxpcall(function()
end
local stat, err = util.coxpcall(function()