Fix unhandled track values for leafs
authorSteven Barth <steven@midlink.org>
Fri, 22 Aug 2008 21:52:36 +0000 (21:52 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 22 Aug 2008 21:52:36 +0000 (21:52 +0000)
libs/web/luasrc/dispatcher.lua

index 2de5ea4..3e21631 100644 (file)
@@ -125,18 +125,23 @@ function dispatch(request)
        local c = context.tree
        local track = {}
        local args = {}
+       context.args = context.path
        local n
 
        for i, s in ipairs(request) do
                c = c.nodes[s]
                n = i
-               if not c or c.leaf then
+               if not c then
                        break
                end
 
                for k, v in pairs(c) do
                        track[k] = v
                end
+               
+               if c.leaf then
+                       break
+               end
        end
 
        if c and c.leaf then
@@ -184,6 +189,7 @@ function dispatch(request)
                        if authen then
                                local user = authen(luci.sys.user.checkpasswd, def)
                                if not user or not luci.util.contains(accs, user) then
+                                       luci.http.status(403, "Forbidden")
                                        return
                                else
                                        local sid = luci.sys.uniqueid(16)