koush / AndroidAsync

Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.
Other
7.52k stars 1.56k forks source link

Invalid Transfer-Encoding header in WebSockets #317

Open sebokmarton opened 9 years ago

sebokmarton commented 9 years ago

Hi,

The HTTP response for the WebSocket handshake contains the Transfer-Encoding: chunked header that is invalid in this context (see https://issues.apache.org/bugzilla/show_bug.cgi?id=54067, https://issues.apache.org/bugzilla/show_bug.cgi?id=56707) and it makes the .NET WebSocket client swallow the first message from the server.

A quick fix is adding response.getHeaders().set("Transfer-Encoding", ""); to the WebSocketImpl constructor, but I can't see its further effects in library. Could you please check if it's not causing any trouble?

Thank you very much!

Cheers, Marton

GarageGadget commented 6 years ago

Hi,

The Transfer-Encoding header is not required for Web Sockets.

Please update library.

Regards, Brent