Skip to content

Commit

Permalink
[feature] Add option to support late addition of headers
Browse files Browse the repository at this point in the history
This supports the use-case where headers need to be added that depend on
the socket connection (e.g. for TLS channel binding).
  • Loading branch information
mvduin committed Mar 3, 2023
1 parent 41dc56a commit cde02b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,11 @@ function initAsClient(websocket, address, protocols, options) {
});
});

req.end();
if (typeof opts.finishRequest === 'function') {
opts.finishRequest(req, websocket);
} else {
req.end();
}
}

/**
Expand Down

0 comments on commit cde02b2

Please sign in to comment.