aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-04-19 12:19:15 +0200
committerKim Alvefur <zash@zash.se>2016-04-19 12:19:15 +0200
commita0757fdf8530bdaa2c56118c9cc0a5c784dd4697 (patch)
treef411a9394d03e44b705ed6019f81e16d2a71844a /plugins
parentcee9ce09a0420cea441a8c3d38e90a8f42deee21 (diff)
downloadprosody-a0757fdf8530bdaa2c56118c9cc0a5c784dd4697.tar.gz
prosody-a0757fdf8530bdaa2c56118c9cc0a5c784dd4697.zip
mod_bosh: Return a proper BOSH error response from XML parse error callback (see #343)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua5
1 files 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