koush/android-websockets — pull request #30 by rahulparsani (2014-01-30 15:42:19+00:00)
Title: Better handle queries when building the session url

Hey Koush. I found an issue using query parameters in the SocketIOClient connection url.

My socket url is of the form

http://localhost:80?foo=bar

SocketIORequest correctly appends "/socket.io/1/" to the url using Uri.Builder making it

http://localhost:80/socket.io/1/?foo=bar

Once a successful SocketIOConnection is made, the session url is constructed by appending the session to the request url directly. This buggers up query parameters breaking the url.

http://localhost:80/socket.io/1/?foo=bar/ztRH4c0RG7GQ8nIzoa5J/

My changes instead use Uri.Builder, similar to what is done in the SocketIORequest, to construct the session url.

http://localhost:80/socket.io/1/websocket/N1MtCSEO6PqyJKqeoa5K?foo=bar