Don't use map() to generate masks.
This commit is contained in:
@@ -230,8 +230,9 @@ var instance = {
|
||||
buffer.copy(frame, offset + insert);
|
||||
|
||||
if (this._masking) {
|
||||
mask = new Buffer([1,2,3,4].map(function() { return Math.floor(Math.random() * 256) }));
|
||||
mask.copy(frame, header);
|
||||
mask = [Math.floor(Math.random() * 256), Math.floor(Math.random() * 256),
|
||||
Math.floor(Math.random() * 256), Math.floor(Math.random() * 256)];
|
||||
new Buffer(mask).copy(frame, header);
|
||||
Protocol8Parser.mask(frame, mask, offset);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user