From f9b6dfabdc218dcbf4e0674ff64950a2d7a44201 Mon Sep 17 00:00:00 2001 From: lookshe Date: Mon, 29 Jan 2018 12:04:01 +0100 Subject: possibility to set external url as https --- prosody-module/mod_http_upload_external/mod_http_upload_external.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'prosody-module/mod_http_upload_external') diff --git a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua index e2e0107..068961e 100644 --- a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua +++ b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua @@ -15,8 +15,9 @@ local xmpp_server_key = module:get_option("http_upload_external_server_key"); local filetransfer_manager_ui_url = module:get_option("filetransfer_manager_ui_url"); -- imports +require"https"; local st = require"util.stanza"; -local http = require"socket.http"; +local http = (string.len(url) >= 5 and string.sub(url,1,5) == "https") and require"ssl.https" or require"socket.http"; local json = require"util.json"; local dataform = require "util.dataforms".new; local ltn12 = require"ltn12"; -- cgit v1.2.3 From aaa63c4d17f6c869fc4a6c52d48304aae68b5651 Mon Sep 17 00:00:00 2001 From: lookshe Date: Mon, 29 Jan 2018 12:06:27 +0100 Subject: fixed copy paste error --- prosody-module/mod_http_upload_external/mod_http_upload_external.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prosody-module/mod_http_upload_external') diff --git a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua index 068961e..001894c 100644 --- a/prosody-module/mod_http_upload_external/mod_http_upload_external.lua +++ b/prosody-module/mod_http_upload_external/mod_http_upload_external.lua @@ -17,7 +17,7 @@ local filetransfer_manager_ui_url = module:get_option("filetransfer_manager_ui_u -- imports require"https"; local st = require"util.stanza"; -local http = (string.len(url) >= 5 and string.sub(url,1,5) == "https") and require"ssl.https" or require"socket.http"; +local http = (string.len(external_url) >= 5 and string.sub(external_url,1,5) == "https") and require"ssl.https" or require"socket.http"; local json = require"util.json"; local dataform = require "util.dataforms".new; local ltn12 = require"ltn12"; -- cgit v1.2.3