Skip to content

Commit

Permalink
preserve Upgrade header
Browse files Browse the repository at this point in the history
end request in hijack mode
  • Loading branch information
schummar committed Jun 13, 2024
1 parent 049e1aa commit 63f5803
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Modem.prototype.dial = function (options, callback) {

if (options.hijack) {
optionsf.headers.Connection = 'Upgrade';
optionsf.headers.Upgrade = 'tcp';
optionsf.headers.Upgrade ??= 'tcp';
}

if (this.socketPath) {
Expand Down Expand Up @@ -366,7 +366,7 @@ Modem.prototype.buildRequest = function (options, context, data, callback) {
data.pipe(req);
}

if (!context.hijack && !context.openStdin && (typeof data === 'string' || data === undefined || Buffer.isBuffer(data))) {
if (!context.openStdin && (typeof data === 'string' || data === undefined || Buffer.isBuffer(data))) {
req.end();
}
};
Expand Down

0 comments on commit 63f5803

Please sign in to comment.