Skip to content

Commit 4695ad0

Browse files
Updating JWS to new implementation (Draft 17 to 6455, RFC compliant)
Fixes #79
1 parent 2dce3c6 commit 4695ad0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies {
3434
compile 'net.sourceforge.streamsupport:streamsupport:1.5.5'
3535
compile 'net.sourceforge.streamsupport:streamsupport-cfuture:1.5.5'
3636
// Supported transports
37-
compile 'org.java-websocket:Java-WebSocket:1.3.4'
37+
compile 'org.java-websocket:Java-WebSocket:1.3.6'
3838
compile 'com.squareup.okhttp3:okhttp:3.8.1'
3939
implementation 'com.android.support:support-annotations:24.2.0'
4040
}

lib/src/main/java/ua/naiksoftware/stomp/WebSocketsConnectionProvider.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import org.java_websocket.WebSocket;
88
import org.java_websocket.client.WebSocketClient;
9-
import org.java_websocket.drafts.Draft_17;
9+
import org.java_websocket.drafts.Draft_6455;
1010
import org.java_websocket.exceptions.InvalidDataException;
1111
import org.java_websocket.handshake.ClientHandshake;
1212
import org.java_websocket.handshake.ServerHandshake;
@@ -46,7 +46,6 @@ class WebSocketsConnectionProvider extends AbstractConnectionProvider {
4646
mConnectHttpHeaders = connectHttpHeaders != null ? connectHttpHeaders : new HashMap<>();
4747
}
4848

49-
@NonNull
5049
@Override
5150
public void rawDisconnect() {
5251
mWebSocketClient.close();
@@ -57,7 +56,7 @@ void createWebSocketConnection() {
5756
if (haveConnection)
5857
throw new IllegalStateException("Already have connection to web socket");
5958

60-
mWebSocketClient = new WebSocketClient(URI.create(mUri), new Draft_17(), mConnectHttpHeaders, 0) {
59+
mWebSocketClient = new WebSocketClient(URI.create(mUri), new Draft_6455(), mConnectHttpHeaders, 0) {
6160

6261
@Override
6362
public void onWebsocketHandshakeReceivedAsClient(WebSocket conn, ClientHandshake request, @NonNull ServerHandshake response) throws InvalidDataException {

0 commit comments

Comments
 (0)