mod_http: Return a static string from module:http_url() when no ports are enabled and log a warning
authorKim Alvefur <zash@zash.se>
Mon, 23 Mar 2015 18:45:02 +0100
changeset 6601 4b4852c4f96a
parent 6600 321321f566fb
child 6602 f93e1b2ec327
mod_http: Return a static string from module:http_url() when no ports are enabled and log a warning
plugins/mod_http.lua
--- a/plugins/mod_http.lua	Mon Mar 23 18:44:12 2015 +0100
+++ b/plugins/mod_http.lua	Mon Mar 23 18:45:02 2015 +0100
@@ -69,6 +69,8 @@
 			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)