diff --git a/Package.swift b/Package.swift index f7d8304..04e8fbb 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,5 @@ import PackageDescription let package = Package( - name: "SocketIOClientSwift" + name: "SocketIO" ) diff --git a/Socket.IO-Client-Swift.podspec b/Socket.IO-Client-Swift.podspec index 47c0b88..b7e4897 100644 --- a/Socket.IO-Client-Swift.podspec +++ b/Socket.IO-Client-Swift.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.license = { :type => 'MIT' } s.author = { "Erik" => "nuclear.ace@gmail.com" } s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.10' + s.osx.deployment_target = '10.9' s.tvos.deployment_target = '9.0' s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v7.0.3' } s.source_files = "Source/**/*.swift" diff --git a/SocketIO-MacTests/SocketParserTest.swift b/SocketIO-MacTests/SocketParserTest.swift index 5e85798..559ca33 100644 --- a/SocketIO-MacTests/SocketParserTest.swift +++ b/SocketIO-MacTests/SocketParserTest.swift @@ -26,8 +26,9 @@ class SocketParserTest: XCTestCase { "0/swift": ("/swift", [], [], -1), "1/swift": ("/swift", [], [], -1), "4\"ERROR\"": ("/", ["ERROR"], [], -1), - "4{\"test\":2}": ("/", [["test": 2] as NSDictionary], [], -1), - "41": ("/", [1], [], -1)] + "4{\"test\":2}": ("/", [["test": 2]], [], -1), + "41": ("/", [1], [], -1), + "4[1, \"hello\"]": ("/", [1, "hello"], [], -1)] func testDisconnect() { let message = "1" @@ -99,6 +100,11 @@ class SocketParserTest: XCTestCase { validateParseResult(message) } + func testErrorTypeArray() { + let message = "4[1, \"hello\"]" + validateParseResult(message) + } + func testInvalidInput() { let message = "8" switch testSocket.parseString(message) { diff --git a/Source/SocketEngine.swift b/Source/SocketEngine.swift index a834645..994d799 100644 --- a/Source/SocketEngine.swift +++ b/Source/SocketEngine.swift @@ -354,10 +354,11 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll private func handleNOOP() { doPoll() } - + private func handleOpen(openData: String) { guard let json = try? openData.toNSDictionary() else { didError(reason: "Error parsing open packet") + return } diff --git a/Source/SocketParsable.swift b/Source/SocketParsable.swift index c046893..7c9ce21 100644 --- a/Source/SocketParsable.swift +++ b/Source/SocketParsable.swift @@ -107,17 +107,17 @@ extension SocketParsable { } } - let d = message[reader.advance(by: 1)..