Commit 870c65da authored by daryl herzmann's avatar daryl herzmann

Merge pull request #352 from tevans/OF-938

OF-938: Apply packet namespace via string insert
parents 90b26b2d 6965c13e
......@@ -1169,9 +1169,13 @@ public class HttpSession extends LocalClientSession {
for (Packet packet : elements) {
// Append packet namespace according XEP-0206 if needed
if (Namespace.NO_NAMESPACE.equals(packet.getElement().getNamespace())) {
packet.getElement().add(Namespace.get("jabber:client"));
// use string-based operation here to avoid cascading xmlns wonkery
StringBuilder packetXml = new StringBuilder(packet.toXML());
packetXml.insert(packetXml.indexOf(" "), " xmlns=\"jabber:client\"");
this.packets.add(packetXml.toString());
} else {
this.packets.add(packet.toXML());
}
this.packets.add(packet.toXML());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment