Skip to content

Commit

Permalink
Merge pull request #59 from marain87/master
Browse files Browse the repository at this point in the history
#58 fix open socket with custom header issue
  • Loading branch information
WrathChaos authored Jul 25, 2019
2 parents 52c6852 + 6686c68 commit 1aa33a2
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 1aa33a2

Please sign in to comment.