mod_bosh: Reject fractional 'wait' (See #343)
authorKim Alvefur <zash@zash.se>
Tue, 19 Apr 2016 12:33:58 +0200
changeset 7384 a05bf94646ba
parent 7383 d24d88feed76
child 7385 c8923f882274
child 7388 17929cdacec2
mod_bosh: Reject fractional 'wait' (See #343)
plugins/mod_bosh.lua
--- a/plugins/mod_bosh.lua	Tue Apr 19 12:19:15 2016 +0200
+++ b/plugins/mod_bosh.lua	Tue Apr 19 12:33:58 2016 +0200
@@ -261,7 +261,7 @@
 			response:send(tostring(close_reply));
 			return;
 		end
-		if not rid or (not wait and attr.wait or wait < 0) then
+		if not rid or (not wait and attr.wait or wait < 0 or wait % 1 ~= 0) then
 			log("debug", "BOSH client sent invalid rid or wait attributes: rid=%s, wait=%s", tostring(attr.rid), tostring(attr.wait));
 			local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
 				["xmlns:stream"] = xmlns_streams, condition = "bad-request" });