Skip to content
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

Too many axios requests are made only to make one requests #13

Open
manodupont opened this issue Jul 22, 2022 · 0 comments
Open

Too many axios requests are made only to make one requests #13

manodupont opened this issue Jul 22, 2022 · 0 comments

Comments

@manodupont
Copy link

manodupont commented Jul 22, 2022

Hello, this is more of a general issue or question.

I used v1.2.1 for about 5 months. Everything seemed to work pretty well and on top of that, it was fast. But since yesterday, it I started to receive some 401 errors coming up. Correct, creds has change. So I just switched the creds. But then, even with the new creds, only 401 errors were coming up. So i decided to upgrade axios-ntlm version. Maybe it would help me understand, or fix, or give me some clues about whats going on and surprisingly, it worked. But it worked in a different way than it was working before... so thats my issue...

To understand what was going on, I added axios interceptors to log the requests. What i see as a difference between 1.2.1 and 1.3.0 is the amount of requests axios is making to finally get up to work and the amount of time it took.

The code i used was like that:

console.log('Request ...')
/** @type {NtlmCredentials} */
const credentials = {
	username: this._config.auth.username,
	password: this._config.auth.password,
	domain: this._config.auth.domain,
}

const request = NtlmClient(credentials)
request.interceptors.request.use(this._axiosLogger.logAxiosRequest())
request.interceptors.response.use(this._axiosLogger.logAxiosResponse())
const res = await request({ url, ...options })
console.log('Response ...')

Observations
using 1.2.1, I could see like 3 requests made then I got a response.
using 1.3.0 i have like 50 requests made and often always the same request kind of in a cyclic way ... then I would finally get a response.

I also tested with postman, using the same creds and the same request. Results are, 200OK, took 3.68s to get response and it loaded 2.41mb. Good. Always the same amount of time.

Anyone can point me in any direction related to that ?

How come Ntlm is using multiple requests. I would expect 2 requests, no matter what. One to authenticate, then the one you got to make.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant