nuclearace / Socket.IO-Client-Swift

socket.io-client for Swift
Other
361 stars 53 forks source link

Wrong URL escaping for connectParams #115

Open Pash237 opened 8 years ago

Pash237 commented 8 years ago

Since commit https://github.com/nuclearace/Socket.IO-Client-Swift/commit/b67b6abbdfaa87abcf86ae7ec72da0f951e73b7a connectParams passed to SocketIOClient init escaped in a wrong way.

For example, I pass a dictionary with “session_id” parameter which may look as hGx+u1d/ozkpZ5gQ==. On the server side Socket.IO library reads this parameter with space instead of “+” character. I think that the reason for this is the way NSURLComponents URL encode works.

This is a method which causes a problem: https://github.com/nuclearace/Socket.IO-Client-Swift/blob/master/Source/SocketEngine.swift#L227