codebutler / android-websockets

Bare minimum websockets (hybi13/RFC) client for Android
713 stars 494 forks source link

Client not seeing the "Sec-WebSocket-Accept" header #23

Open raduvarga opened 9 years ago

raduvarga commented 9 years ago

My server was sending the header as "Sec-Websocket-Accept" and not "Sec-WebSocket-Accept" (notice the capital "s"). The solution is change this line in "WebSocketClient":

if (header.getName().equals("Sec-WebSocket-Accept")) {

to this

if (header.getName().toLowerCase().equals("sec-websocket-accept")) {

According to the HTTP header standards: "Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive."