X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Flucid-http%2Fluasrc%2Flucid%2Fhttp%2Fserver.lua;h=eb6f6f54f8c500fecfb193d536fe034b4be1ef0a;hp=cb10813b9ee7aee499c3a75b2e2c92c0653b280c;hb=17e7f67a7c0bbfa26154005a49faf74b3573ff5d;hpb=ce98fdd80f549ab72c25c5cd799d4946433e4e2c diff --git a/libs/lucid-http/luasrc/lucid/http/server.lua b/libs/lucid-http/luasrc/lucid/http/server.lua index cb10813b9e..eb6f6f54f8 100644 --- a/libs/lucid-http/luasrc/lucid/http/server.lua +++ b/libs/lucid-http/luasrc/lucid/http/server.lua @@ -198,6 +198,10 @@ function VHost.process(self, request, ...) -- Call URI part request.env.PATH_INFO = uri + if self.default and uri == "/" then + return 302, {Location = self.default} + end + for k, h in pairs(self.handlers) do if #k > hlen then if uri == k or (uri:sub(1, #k) == k and uri:byte(#k+1) == sc) then