Skip to content

Commit 1aa33a2

Browse files
authored
Merge pull request #59 from marain87/master
#58 fix open socket with custom header issue
2 parents 52c6852 + 6686c68 commit 1aa33a2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Example/StompClientLib.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ public class StompClientLib: NSObject, SRWebSocketDelegate {
134134
private func connect() {
135135
if socket?.readyState == .OPEN {
136136
// Support for Spring Boot 2.1.x
137-
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
137+
if (connectionHeaders == nil) {
138+
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
139+
}
138140
// at the moment only anonymous logins
139141
self.sendFrame(command: StompCommands.commandConnect, header: connectionHeaders, body: nil)
140142
} else {

StompClientLib/Classes/StompClientLib.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ public class StompClientLib: NSObject, SRWebSocketDelegate {
134134
private func connect() {
135135
if socket?.readyState == .OPEN {
136136
// Support for Spring Boot 2.1.x
137-
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
137+
if (connectionHeaders == nil) {
138+
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
139+
}
138140
// at the moment only anonymous logins
139141
self.sendFrame(command: StompCommands.commandConnect, header: connectionHeaders, body: nil)
140142
} else {

0 commit comments

Comments
 (0)