Skip to content

Commit 14f35a7

Browse files
committed
[fix] listen to 'aborted' to mute emitting of 'aborted' error.
1 parent 08c6c8b commit 14f35a7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/websocket.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,11 @@ function initAsClient(websocket, address, protocols, options) {
559559
const location = res.headers.location;
560560
const statusCode = res.statusCode;
561561

562+
res.on('aborted', () => {
563+
// Do nothing...
564+
// Registering this listener mutes 'aborted' error from being emitted.
565+
});
566+
562567
if (
563568
location &&
564569
opts.followRedirects &&

0 commit comments

Comments
 (0)