-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
Milestone
Description
Hi,
I noticed that there in error message Content-Type content you have missed \r at one place. Which is causing issue on some platform/library (used by client). Class WebSocketImpl
private ByteBuffer generateHttpResponseDueToError( int errorCode ) {
String errorCodeDescription;
switch(errorCode) {
case 404:
errorCodeDescription = "404 WebSocket Upgrade Failure";
break;
case 500:
default:
errorCodeDescription = "500 Internal Server Error";
}
return ByteBuffer.wrap( Charsetfunctions.asciiBytes( "HTTP/1.1 " + errorCodeDescription + "\r\nContent-Type: text/html\nServer: TooTallNate Java-WebSocket\r\nContent-Length: " + ( 48 + errorCodeDescription.length() ) + "\r\n\r\n<html><head></head><body><h1>" + errorCodeDescription + "</h1></body></html>" ) );
}