Skip to content

Commit

Permalink
Fix issue due to vscode-docker's usage of docker-modem
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored Oct 17, 2019
1 parent 4293929 commit d2f92b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var defaultOpts = function() {
} else if (host.protocol === 'ssh:') {
opts.protocol = 'ssh';
opts.username = host.username;
opts.sshAuthAgent = process.env.SSH_AUTH_SOCK;
} else {
opts.protocol = 'http';
}
Expand Down Expand Up @@ -84,6 +85,7 @@ var Modem = function(options) {
this.checkServerIdentity = opts.checkServerIdentity;
this.agent = opts.agent;
this.headers = opts.headers || {};
this.sshAuthAgent = opts.sshAuthAgent;

if (this.key && this.cert && this.ca) {
this.protocol = 'https';
Expand Down Expand Up @@ -205,7 +207,7 @@ Modem.prototype.buildRequest = function(options, context, data, callback) {
var connectionTimeoutTimer;

var opts = self.protocol === 'ssh' ? Object.assign(options, {
agent: ssh({'host': self.host, 'port': self.port, 'username': self.username, 'agent': process.env.SSH_AUTH_SOCK}),
agent: ssh({'host': self.host, 'port': self.port, 'username': self.username, 'agent': self.sshAuthAgent}),
protocol: 'http:'
}) : options;

Expand Down

0 comments on commit d2f92b2

Please sign in to comment.