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,11 +1169,15 @@ public class HttpSession extends LocalClientSession { ...@@ -1169,11 +1169,15 @@ public class HttpSession extends LocalClientSession {
for (Packet packet : elements) { for (Packet packet : elements) {
// Append packet namespace according XEP-0206 if needed // Append packet namespace according XEP-0206 if needed
if (Namespace.NO_NAMESPACE.equals(packet.getElement().getNamespace())) { 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());
} }
} }
}
public String getDeliverable() { public String getDeliverable() {
if (text == null) { if (text == null) {
......
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