fix encoding of postWait messages sent over websocket

This commit is contained in:
Erik 2015-12-20 15:36:42 -05:00
parent d94a1901ca
commit 97d4f3f527
2 changed files with 3 additions and 3 deletions

View File

@ -678,7 +678,7 @@ extension SocketEngine {
guard let ws = self.ws else { return } guard let ws = self.ws else { return }
for msg in postWait { for msg in postWait {
ws.writeString(msg) ws.writeString(fixDoubleUTF8(msg))
} }
postWait.removeAll(keepCapacity: true) postWait.removeAll(keepCapacity: true)

View File

@ -115,7 +115,7 @@ struct SocketPacket {
type: SocketPacket.logType) type: SocketPacket.logType)
} }
} else if let str = arg as? String { } else if let str = arg as? String {
restOfMessage += "\"\((str["\n"] ~= "\\\\n")["\r"] ~= "\\\\r")\"," restOfMessage += "\"" + ((str["\n"] ~= "\\\\n")["\r"] ~= "\\\\r") + "\","
} else if arg is NSNull { } else if arg is NSNull {
restOfMessage += "null," restOfMessage += "null,"
} else { } else {