Move MAX_MESSAGE_SIZE
assertion
This commit is contained in:
parent
57c41ad5f1
commit
4ef56667e2
1 changed files with 4 additions and 4 deletions
|
@ -188,6 +188,10 @@ export default class WebSocketResource extends EventTarget {
|
|||
id,
|
||||
},
|
||||
}).finish();
|
||||
strictAssert(
|
||||
bytes.length <= MAX_MESSAGE_SIZE,
|
||||
'WebSocket request byte size exceeded'
|
||||
);
|
||||
|
||||
strictAssert(!this.shuttingDown, 'Cannot send request, shutting down');
|
||||
this.addActive(id);
|
||||
|
@ -210,10 +214,6 @@ export default class WebSocketResource extends EventTarget {
|
|||
});
|
||||
});
|
||||
|
||||
strictAssert(
|
||||
bytes.length <= MAX_MESSAGE_SIZE,
|
||||
'WebSocket request byte size exceeded'
|
||||
);
|
||||
this.socket.sendBytes(Buffer.from(bytes));
|
||||
|
||||
return promise;
|
||||
|
|
Loading…
Reference in a new issue