projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5aec97f
)
mod_bosh: Return a proper BOSH error response instead of deprecated(?) status code...
author
Kim Alvefur
<zash@zash.se>
Tue, 19 Apr 2016 10:16:17 +0000
(12:16 +0200)
committer
Kim Alvefur
<zash@zash.se>
Tue, 19 Apr 2016 10:16:17 +0000
(12:16 +0200)
plugins/mod_bosh.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_bosh.lua
b/plugins/mod_bosh.lua
index 845df61a5639e85de9a65995f0d6509f33cade7e..64d52f9106aee7ea15ab856ff5e12a42b3165845 100644
(file)
--- a/
plugins/mod_bosh.lua
+++ b/
plugins/mod_bosh.lua
@@
-129,7
+129,9
@@
function handle_POST(event)
local ok, err = stream:feed(body);
if not ok then
module:log("warn", "Error parsing BOSH payload; %s", err)
local ok, err = stream:feed(body);
if not ok then
module:log("warn", "Error parsing BOSH payload; %s", err)
- return 400;
+ local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
+ ["xmlns:stream"] = xmlns_streams, condition = "bad-request" });
+ return tostring(close_reply);
end
-- Stanzas (if any) in the request have now been processed, and
end
-- Stanzas (if any) in the request have now been processed, and
@@
-184,7
+186,9
@@
function handle_POST(event)
return; -- A response has been sent already
end
module:log("warn", "Unable to associate request with a session (incomplete request?)");
return; -- A response has been sent already
end
module:log("warn", "Unable to associate request with a session (incomplete request?)");
- return 400;
+ local close_reply = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate",
+ ["xmlns:stream"] = xmlns_streams, condition = "item-not-found" });
+ return tostring(close_reply) .. "\n";
end
end