Skip to content

Commit

Permalink
Correctly add the https agent to axios (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Good committed Aug 20, 2021
1 parent 94fada0 commit 65c5eec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/security/ClientSSLSecurity.ts
Expand Up @@ -82,6 +82,6 @@ export class ClientSSLSecurity implements ISecurity {
httpsAgent = new https.Agent(options);
}

options.agent = httpsAgent;
options.httpsAgent = httpsAgent;
}
}
2 changes: 1 addition & 1 deletion src/security/ClientSSLSecurityPFX.ts
Expand Up @@ -51,6 +51,6 @@ export class ClientSSLSecurityPFX implements ISecurity {
options.passphrase = this.passphrase;
}
_.merge(options, this.defaults);
options.agent = new https.Agent(options);
options.httpsAgent = new https.Agent(options);
}
}
6 changes: 3 additions & 3 deletions test/security/ClientSSLSecurity.js
Expand Up @@ -101,7 +101,7 @@ describe('ClientSSLSecurity', function() {
instance.addOptions(firstOptions);
instance.addOptions(secondOptions);

firstOptions.agent.should.not.equal(secondOptions.agent);
firstOptions.httpsAgent.should.not.equal(secondOptions.httpsAgent);
});

it('should return the same agent if parameter is present', function () {
Expand All @@ -112,7 +112,7 @@ describe('ClientSSLSecurity', function() {
instance.addOptions(firstOptions);
instance.addOptions(secondOptions);

firstOptions.agent.should.equal(secondOptions.agent);
firstOptions.httpsAgent.should.equal(secondOptions.httpsAgent);
});

it('should return the same agent if set in defaults', function () {
Expand All @@ -123,7 +123,7 @@ describe('ClientSSLSecurity', function() {
instance.addOptions(firstOptions);
instance.addOptions(secondOptions);

firstOptions.agent.should.equal(secondOptions.agent);
firstOptions.httpsAgent.should.equal(secondOptions.httpsAgent);
});
});
});

0 comments on commit 65c5eec

Please sign in to comment.