From 6a1e17435e5acda2f5b66d67bed3e3ad48becf72 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 19 Apr 2016 12:19:15 +0200 Subject: [PATCH] mod_bosh: Return a proper BOSH error response from XML parse error callback (see #343) --- plugins/mod_bosh.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 6ec3ff16..1f928eed 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -412,8 +412,9 @@ function stream_callbacks.error(context, error) log("debug", "Error parsing BOSH request payload; %s", error); if not context.sid then local response = context.response; - response.status_code = 400; - response:send(); + local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate", + ["xmlns:stream"] = xmlns_streams, condition = "bad-request" }); + response:send(tostring(close_reply)); return; end -- 2.30.2