@@ -119,23 +119,24 @@ public static HandshakeBuilder translateHandshakeHttp( ByteBuffer buf, Role role
119119
120120 if ( role == Role .CLIENT ) {
121121 // translating/parsing the response from the SERVER
122- if (!"HTTP/1.1" .equalsIgnoreCase (firstLineTokens [0 ])) {
123- throw new InvalidHandshakeException ( "Invalid status line received: " + firstLineTokens [0 ] );
124- }
125122 if (!"101" .equals (firstLineTokens [1 ])) {
126- throw new InvalidHandshakeException ( "Invalid status code received: " + firstLineTokens [1 ] );
123+ throw new InvalidHandshakeException ( "Invalid status code received: " + firstLineTokens [1 ] + " Status line: " + line );
127124 }
125+ if (!"HTTP/1.1" .equalsIgnoreCase (firstLineTokens [0 ])) {
126+ throw new InvalidHandshakeException ( "Invalid status line received: " + firstLineTokens [0 ] + " Status line: " + line );
127+ }
128+
128129 handshake = new HandshakeImpl1Server ();
129130 ServerHandshakeBuilder serverhandshake = (ServerHandshakeBuilder ) handshake ;
130131 serverhandshake .setHttpStatus ( Short .parseShort ( firstLineTokens [ 1 ] ) );
131132 serverhandshake .setHttpStatusMessage ( firstLineTokens [ 2 ] );
132133 } else {
133134 // translating/parsing the request from the CLIENT
134135 if (!"GET" .equalsIgnoreCase (firstLineTokens [0 ])) {
135- throw new InvalidHandshakeException ( "Invalid request method received: " + firstLineTokens [0 ] );
136+ throw new InvalidHandshakeException ( "Invalid request method received: " + firstLineTokens [0 ] + " Status line: " + line );
136137 }
137138 if (!"HTTP/1.1" .equalsIgnoreCase (firstLineTokens [2 ])) {
138- throw new InvalidHandshakeException ( "Invalid status line received: " + firstLineTokens [2 ] );
139+ throw new InvalidHandshakeException ( "Invalid status line received: " + firstLineTokens [2 ] + " Status line: " + line );
139140 }
140141 ClientHandshakeBuilder clienthandshake = new HandshakeImpl1Client ();
141142 clienthandshake .setResourceDescriptor ( firstLineTokens [ 1 ] );
0 commit comments