Skip to content

Commit

Permalink
#58 fix open socket with custom header issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kavin committed Jul 25, 2019
1 parent 52c6852 commit 6686c68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Example/StompClientLib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ public class StompClientLib: NSObject, SRWebSocketDelegate {
private func connect() {
if socket?.readyState == .OPEN {
// Support for Spring Boot 2.1.x
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
if (connectionHeaders == nil) {
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
}
// at the moment only anonymous logins
self.sendFrame(command: StompCommands.commandConnect, header: connectionHeaders, body: nil)
} else {
Expand Down
4 changes: 3 additions & 1 deletion StompClientLib/Classes/StompClientLib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ public class StompClientLib: NSObject, SRWebSocketDelegate {
private func connect() {
if socket?.readyState == .OPEN {
// Support for Spring Boot 2.1.x
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
if (connectionHeaders == nil) {
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
}
// at the moment only anonymous logins
self.sendFrame(command: StompCommands.commandConnect, header: connectionHeaders, body: nil)
} else {
Expand Down

0 comments on commit 6686c68

Please sign in to comment.