changeset 3561:deb5ece56c49

mod_turncredentials: Convert numeric attributes to strings (fixes #1339)
author Kim Alvefur <zash@zash.se>
date Tue, 09 Apr 2019 23:23:30 +0200
parents 0ebb7112c102
children b33b2fbdc713
files mod_turncredentials/mod_turncredentials.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_turncredentials/mod_turncredentials.lua	Tue Apr 09 18:05:28 2019 +0200
+++ b/mod_turncredentials/mod_turncredentials.lua	Tue Apr 09 23:23:30 2019 +0200
@@ -26,8 +26,8 @@
     local userpart = tostring(now);
     local nonce = base64.encode(hmac_sha1(secret, tostring(userpart), false));
     origin.send(st.reply(stanza):tag("services", {xmlns = "urn:xmpp:extdisco:1"})
-        :tag("service", { type = "stun", host = host, port = port }):up()
-        :tag("service", { type = "turn", host = host, port = port, username = userpart, password = nonce, ttl = ttl}):up()
+        :tag("service", { type = "stun", host = host, port = ("%d"):format(port) }):up()
+        :tag("service", { type = "turn", host = host, port = ("%d"):format(port), username = userpart, password = nonce, ttl = ("%d"):format(ttl) }):up()
     );
     return true;
 end);