libs/lucid-http: fix regressions with recent git uci
[project/luci.git] / libs / lucid-http / luasrc / lucid / http / DirectoryPublisher.lua
index f471781..09cade4 100644 (file)
@@ -18,6 +18,9 @@ local srv = require "luci.lucid.http.server"
 module "luci.lucid.http.DirectoryPublisher"
 
 
+--- Prepare a directory publisher and assign it to a given Virtual Host.
+-- @param server HTTP daemon object
+-- @param config publisher configuration
 function factory(server, config)
        config.domain = config.domain or ""
        local vhost = server:get_vhosts()[config.domain] 
@@ -42,6 +45,6 @@ function factory(server, config)
                        vhost:set_handler(v, handler)
                end
        else
-               vhost:set_handler(config.virtual, handler)
+               vhost:set_handler(config.virtual or "", handler)
        end
-end
\ No newline at end of file
+end