Changeset

4697:15c335dc196e

mod_muc_http_auth: Make sure query parameters are URL encoded
author Seve Ferrer <seve@delape.net>
date Thu, 23 Sep 2021 17:13:35 +0200
parents 4696:6a05c9eb964e
children 4698:4157773ed4d3
files mod_muc_http_auth/mod_muc_http_auth.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_http_auth/mod_muc_http_auth.lua	Thu Sep 23 16:41:42 2021 +0200
+++ b/mod_muc_http_auth/mod_muc_http_auth.lua	Thu Sep 23 17:13:35 2021 +0200
@@ -58,7 +58,7 @@
 	-- Nickname is mandatory to enter a MUC
 	if not user_nickname then return; end
 
-	local url = authorization_url .. "?userJID=" .. user_bare_jid .."&mucJID=" .. room.jid .. "&nickname=" .. user_nickname;
+	local url = authorization_url .. "?userJID=" .. urlencode(user_bare_jid) .."&mucJID=" .. urlencode(room.jid) .. "&nickname=" .. urlencode(user_nickname);
 
 	local result = wait_for(http.request(url, options):next(handle_success, handle_error));
 	local response, err = result.response, result.err;