We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5949397 commit 63fdd69Copy full SHA for 63fdd69
src/net/tootallnate/websocket/drafts/Draft_76.java
@@ -156,8 +156,14 @@ public HandshakeBuilder postProcessHandshakeResponseAsServer( Handshakedata requ
156
public Handshakedata translateHandshake( ByteBuffer buf ) throws InvalidHandshakeException {
157
HandshakeBuilder bui = translateHandshakeHttp( buf );
158
ByteBuffer key3buf = readLine( buf );
159
- byte[] key3 = new byte[ key3buf.remaining() ];
160
- key3buf.get( key3 );
+ byte[] key3;
+ if( key3buf == null ){
161
+ key3 = new byte[0];
162
+ }
163
+ else{
164
+ key3 = new byte[ key3buf.remaining() ];
165
+ key3buf.get( key3 );
166
167
// key3 have to be 16 bytes long
168
bui.setContent( key3 );
169
return bui;
0 commit comments