Software /
code /
prosody-modules
Diff
mod_pastebin/mod_pastebin.lua @ 565:9c2eea631811
mod_pastebin: more sensible unconfigured base url formatting, use interface directive if present.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Tue, 17 Jan 2012 01:43:50 +0000 |
parent | 517:f866325305ed |
child | 654:7e444de959bb |
line wrap: on
line diff
--- 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()