# HG changeset patch # User Marco Cirillo # Date 1326764630 0 # Node ID 9c2eea631811c379e61dac56235da5b74c00ef1a # Parent 0b52d82ea0b39856abd645b11ea45776820f9359 mod_pastebin: more sensible unconfigured base url formatting, use interface directive if present. diff -r 0b52d82ea0b3 -r 9c2eea631811 mod_pastebin/mod_pastebin.lua --- a/mod_pastebin/mod_pastebin.lua Tue Jan 17 01:40:58 2012 +0000 +++ b/mod_pastebin/mod_pastebin.lua Tue Jan 17 01:43:50 2012 +0000 @@ -138,9 +138,13 @@ base = options; end - base_url = base_url or ("http://"..module:get_host()..(port ~= 80 and (":"..port) or "").."/"..base.."/"); + if not ssl then + base_url = base_url or ("http://"..module:get_host()..(port ~= 80 and (":"..port) or "").."/"..base.."/"); + else + base_url = base_url or ("https://"..module:get_host()..(port ~= 443 and (":"..port) or "").."/"..base.."/"); + end - httpserver.new{ port = port, base = base, handler = handle_request, ssl = ssl } + httpserver.new{ interface = interface, port = port, base = base, handler = handle_request, ssl = ssl } end local function set_pastes_metatable()