Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed May 5, 2024
1 parent 25c9ceb commit 3145947
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/web/websocket/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let bufIdx = 0

try {
crypto = require('node:crypto')
buffer = crypto.randomFillSync(Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE)
/* c8 ignore next 3 */
} catch {

Expand All @@ -31,6 +30,9 @@ class WebsocketFrameSend {
*/
constructor (data) {
this.frameData = data
if (buffer === null) {
buffer = crypto.randomFillSync(Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE)
}
this.maskKey = generateMask()
}

Expand Down

0 comments on commit 3145947

Please sign in to comment.