Add native support for homepages
[project/luci.git] / libs / lucid-http / luasrc / lucid / http / server.lua
index cb10813..eb6f6f5 100644 (file)
@@ -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