mod_http: Return a static string from module:http_url() when no ports are enabled...
authorKim Alvefur <zash@zash.se>
Mon, 23 Mar 2015 17:45:02 +0000 (18:45 +0100)
committerKim Alvefur <zash@zash.se>
Mon, 23 Mar 2015 17:45:02 +0000 (18:45 +0100)
plugins/mod_http.lua

index 9ff3af748e7490627245b1578ef8ca7260ce7859..9b574bc8eff9c45985174ff1e20c9cdd91dbdeb1 100644 (file)
@@ -69,6 +69,8 @@ function moduleapi.http_url(module, app_name, default_path)
                        return url_build(url);
                end
        end
+       module:log("warn", "No http ports enabled, can't generate an external URL");
+       return "http://disabled.invalid/";
 end
 
 function module.add_host(module)