Catbuttes/axios-ntlm

Unauthorised error is thrown when using stream to pipe the response

serhiiminin opened this issue · 5 comments

When I use responseType: 'stream' I get the unauthorized error (401).
https://github.com/axios/axios#axios-api

const client = NtlmClient(credentials);

const response = await client({
   url: 'https://example.com',
   method: 'post',
   responseType: 'stream',
   data: { name: "Jack" },
});

response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'));

I use version 1.2.1

I confirm, this issue exists.

+1

Can confirm this issue exists.

Also. Here is the fix.

#11

Thanks goes to @serhiiminin without whom, I would still be questioning my sanity...

@serhiiminin @ma-zal @manodupont please can you check if v1.3.0 fixes your issue. 😃

Hi, sorry for the late reply. I was away for some time.
I can confirm that the issue is gone. Unfortunately, I faced another issue. Now I am getting error 400 Bad Request when making POST requests with the same setup