mod_bosh: Add jabber:client namespace to stanzas with no namespace
authorMatthew Wild <mwild1@gmail.com>
Sun, 4 Jul 2010 18:38:33 +0000 (19:38 +0100)
committerMatthew Wild <mwild1@gmail.com>
Sun, 4 Jul 2010 18:38:33 +0000 (19:38 +0100)
plugins/mod_bosh.lua

index 66a79785dea936ba77779028c768039ccdb8fcb0..e03b2bbdd3f47264ce5b41950a4f7394df16dab2 100644 (file)
@@ -190,6 +190,11 @@ function stream_callbacks.streamopened(request, attr)
                local r, send_buffer = session.requests, session.send_buffer;
                local response = { headers = default_headers }
                function session.send(s)
+                       -- We need to ensure that outgoing stanzas have the jabber:client xmlns
+                       if s.attr and not s.attr.xmlns then
+                               s = st.clone(s);
+                               s.attr.xmlns = "jabber:client";
+                       end
                        --log("debug", "Sending BOSH data: %s", tostring(s));
                        local oldest_request = r[1];
                        if oldest_request then