Socket.IO-Client-Swift icon indicating copy to clipboard operation
Socket.IO-Client-Swift copied to clipboard

Wrong URL escaping for connectParams

Open Pash237 opened this issue 8 years ago • 0 comments

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

Pash237 avatar Mar 25 '16 21:03 Pash237