diff --git a/Example/StompClientLib.swift b/Example/StompClientLib.swift index 591787a..20a9176 100755 --- a/Example/StompClientLib.swift +++ b/Example/StompClientLib.swift @@ -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 { diff --git a/StompClientLib/Classes/StompClientLib.swift b/StompClientLib/Classes/StompClientLib.swift index a25e16f..9ee281f 100755 --- a/StompClientLib/Classes/StompClientLib.swift +++ b/StompClientLib/Classes/StompClientLib.swift @@ -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 {