mod_bosh: Return a proper BOSH error response from XML parse error callback (see #343)
--- a/plugins/mod_bosh.lua Tue Apr 19 12:18:19 2016 +0200
+++ b/plugins/mod_bosh.lua Tue Apr 19 12:19:15 2016 +0200
@@ -412,8 +412,9 @@
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