File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -389,11 +389,18 @@ WebSocketServer stays in memory BECAUSE the closure holds a reference to `this`
389389 const secondByte = infoBuffer [ 1 ] ;
390390
391391 // Extract frame metadata from header bytes
392+ const rsvBits = firstByte & 0b01110000 ;
392393 this . _fin = ( firstByte & 0b10000000 ) === 0b10000000 ;
393394 this . _opcode = firstByte & 0b00001111 ;
394395 this . _masked = ( secondByte & 0b10000000 ) === 0b10000000 ;
395396 this . _initialPayloadSizeIndicator = secondByte & 0b01111111 ;
396397
398+ // No extensions allowed in current version
399+ if ( rsvBits !== 0 ) {
400+ this . _sendClose ( 1002 , "RSV bits must be 0" ) ;
401+ return ;
402+ }
403+
397404 // Validate: RFC 6455 requires client frames to be masked
398405 if ( ! this . _masked ) {
399406 this . _sendClose ( 1002 , "Client frames must be masked" ) ;
You can’t perform that action at this time.
0 commit comments