File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -355,16 +355,18 @@ class WebSocket extends EventEmitter {
355
355
if ( typeof data === 'number' ) data = data . toString ( ) ;
356
356
else if ( ! data ) data = '' ;
357
357
358
- options = options || { } ;
359
- if ( options . fin !== false ) options . fin = true ;
360
- if ( options . binary === undefined ) options . binary = typeof data !== 'string' ;
361
- if ( options . mask === undefined ) options . mask = ! this . _isServer ;
362
- if ( options . compress === undefined ) options . compress = true ;
358
+ const opts = Object . assign ( {
359
+ fin : true ,
360
+ binary : typeof data !== 'string' ,
361
+ mask : ! this . _isServer ,
362
+ compress : true
363
+ } , options ) ;
364
+
363
365
if ( ! this . extensions [ PerMessageDeflate . extensionName ] ) {
364
- options . compress = false ;
366
+ opts . compress = false ;
365
367
}
366
368
367
- this . _sender . send ( data , options , cb ) ;
369
+ this . _sender . send ( data , opts , cb ) ;
368
370
}
369
371
370
372
/**
You can’t perform that action at this time.
0 commit comments