Skip to content

Commit 8928ce2

Browse files
committed
maybe fix #100 and #22
1 parent ebe9384 commit 8928ce2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

SocketIOClientSwift/SocketEngine.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient {
194194
}
195195

196196
private func createWebsocket(andConnect connect:Bool) {
197-
ws = WebSocket(url: NSURL(string: urlWebSocket! + "&sid=\(sid)")!,
197+
let wsUrl = urlWebSocket! + (sid == "" ? "" : "&sid=\(sid)")
198+
199+
ws = WebSocket(url: NSURL(string: wsUrl)!,
198200
cookies: cookies)
199201

200202
if extraHeaders != nil {

0 commit comments

Comments
 (0)