Comparison

plugins/mod_http.lua @ 6598:4b4852c4f96a

mod_http: Return a static string from module:http_url() when no ports are enabled and log a warning
author Kim Alvefur <zash@zash.se>
date Mon, 23 Mar 2015 18:45:02 +0100
parent 6597:321321f566fb
child 6602:61b6a4fc65f1
child 7580:588ed6451984
comparison
equal deleted inserted replaced
6597:321321f566fb 6598:4b4852c4f96a
67 } 67 }
68 if ports_by_scheme[url.scheme] == url.port then url.port = nil end 68 if ports_by_scheme[url.scheme] == url.port then url.port = nil end
69 return url_build(url); 69 return url_build(url);
70 end 70 end
71 end 71 end
72 module:log("warn", "No http ports enabled, can't generate an external URL");
73 return "http://disabled.invalid/";
72 end 74 end
73 75
74 function module.add_host(module) 76 function module.add_host(module)
75 local host = module:get_option_string("http_host", module.host); 77 local host = module:get_option_string("http_host", module.host);
76 local apps = {}; 78 local apps = {};