mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
[websocket] Improve handling of expanded 'open' element
Prior to this fix, Smack requires the 'open' element send on a websocket connection to be collapsed. With the change in this commit, an expanded (eg: `<open ...></open>`) element can also be used. fixes SMACK-935
This commit is contained in:
parent
c7f3e231d0
commit
6244a213c8
2 changed files with 7 additions and 3 deletions
|
@ -95,7 +95,9 @@ public abstract class AbstractWebSocket {
|
|||
static String getStreamFromOpenElement(String openElement) {
|
||||
String streamElement = openElement.replaceFirst("\\A<open ", "<stream:stream ")
|
||||
.replace("urn:ietf:params:xml:ns:xmpp-framing", "jabber:client")
|
||||
.replaceFirst("/>\\s*\\z", " xmlns:stream='http://etherx.jabber.org/streams'>");
|
||||
.replaceFirst("/>\\s*\\z", " xmlns:stream='http://etherx.jabber.org/streams'>")
|
||||
.replaceFirst("></open>\\s*\\z", " xmlns:stream='http://etherx.jabber.org/streams'>");
|
||||
|
||||
return streamElement;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue