libs/lucid-http: fix regressions with recent git uci
[project/luci.git] / libs / lucid-http / luasrc / lucid / http / LuciWebPublisher.lua
index f72b94f..5dc70df 100644 (file)
@@ -56,11 +56,18 @@ function factory(server, config)
                end
        end
 
+       local mypath
        if type(config.virtual) == "table" then
                for _, v in ipairs(config.virtual) do
+                       mypath = mypath or v
                        vhost:set_handler(v, handler)
                end
        else
-               vhost:set_handler(config.virtual, handler)
+               mypath = config.virtual
+               vhost:set_handler(config.virtual or "", handler)
        end
-end
\ No newline at end of file
+
+       if config.home then
+               vhost.default = mypath
+       end
+end