changeset 3347:823156d5885b

mod_conversejs: Strip extra slash if version is set to the empty string
author Kim Alvefur <zash@zash.se>
date Thu, 04 Oct 2018 14:40:32 +0200 (2018-10-04)
parents 03cbffd807bb
children f753cf4f7224
files mod_conversejs/mod_conversejs.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_conversejs/mod_conversejs.lua	Wed Oct 03 13:08:17 2018 +0200
+++ b/mod_conversejs/mod_conversejs.lua	Thu Oct 04 14:40:32 2018 +0200
@@ -13,8 +13,9 @@
 local cdn_url = module:get_option_string("conversejs_cdn", "https://cdn.conversejs.org");
 
 local version = module:get_option_string("conversejs_version", "4.0.1");
-local js_url = module:get_option_string("conversejs_script", cdn_url.."/"..version.."/dist/converse.min.js");
-local css_url = module:get_option_string("conversejs_css", cdn_url.."/"..version.."/css/converse.min.css");
+if version ~= "" then version = "/" .. version end
+local js_url = module:get_option_string("conversejs_script", cdn_url..version.."/dist/converse.min.js");
+local css_url = module:get_option_string("conversejs_css", cdn_url..version.."/css/converse.min.css");
 
 local html_template = ([[
 <!DOCTYPE html>