-
Notifications
You must be signed in to change notification settings - Fork 1.5k
honor httpAgent/httpsAgent when setting ntlm flag (take 2) #1336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
src/http.ts
Outdated
}); | ||
}, { httpAgent: exoptions.httpAgent, | ||
httpsAgent: exoptions.httpsAgent, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to remove this locally, rebuild the project and run new tests, but for some reason tests still pass.
I would assume it should fail without it.
Do I understand it right? Could you please double check it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a look when I get a chance hopefully soon. It is entirely possible there is a bug in the tests :)
@w666 -- so I've done some testing here. TL;DR, the proposes change overall makes sense. To test it i had to dig a bit. Now the question to you would be how would make this available from scope of tests. Once solved, then can fix the tests to query for the agents. I've pushed the instrumentation commit a54e32d. Most of some of it to be reverted once solution is found. I've doubled the number of request-response tests with and without change based on the options, and they all pass, but if I console-log the http(s)Agent at the right spot, they are Summary:
const ntlmReq = NtlmClient(
{
username: exoptions.username,
password: exoptions.password,
workstation: exoptions.workstation || '',
domain: exoptions.domain || '',
},
// Change wanted in the OG PR:
//{ httpAgent: exoptions.httpAgent, httpsAgent: exoptions.httpsAgent },
// A better change per axios-ntlm API?
//options,
);
If we can get access to that return value of |
This PR supersedes PR #1209 (by @unilynx) by adding tests for 'ntlm' to be together with
httpAgent
andhttpsAgent
. I used two different approaches of creating the tests agents inspired from other tests where they were used and by making surentlm
was set totrue
. I've also sync'd it with master.