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

HTTP Stream Broken By NTLM Authentication #151

Closed
sylvanaar opened this issue May 28, 2019 · 3 comments
Closed

HTTP Stream Broken By NTLM Authentication #151

sylvanaar opened this issue May 28, 2019 · 3 comments
Assignees

Comments

@sylvanaar
Copy link

  1. Please check our current Issues to see if someone already reported this https://github.com/Microsoft/typed-rest-client/issues
  2. Take a look at our Instructions for logging issues https://github.com/Microsoft/typed-rest-client/blob/master/CONTRIBUTING.md#instructions-for-logging-issues

Environment

Node version: 10.11.0
Npm version: 6.7.0
OS and version: Mac OSX 10.14.4
typed-rest-client version: 1.2.0

Issue Description

NTLM Authentication does not work

Expected behaviour

With NTLM authentication, API calls should succeed

Actual behaviour

With NTLM authentication, the application build using azure-devops-node-api exits when performing an API Call

Steps to reproduce

  1. Use NTLM authentication with azure-devops-node-api
  2. Call any api

Logs

I have observed that typed-rest-client consumes the api call response instead of allowing the client to consume it itself.

I have observed removing the code to consume the body does remedy the issue for me

    public handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs): Promise<ifm.IHttpClientResponse> {
        return new Promise<ifm.IHttpClientResponse>((resolve, reject) => {
            const callbackForResult = function (err: any, res: ifm.IHttpClientResponse) {
                if (err) {
                    reject(err);
                }
                // We have to readbody on the response before continuing otherwise there is a hang.
                res.readBody().then(() => {  // REMOVE call to readBody, and just call resolve
                    resolve(res);
                });
            };

            this.handleAuthenticationPrivate(httpClient, requestInfo, objs, callbackForResult);
        });
    }
@damccorm damccorm added the bug label May 29, 2019
@vKarter
Copy link

vKarter commented Jul 8, 2019

Please fix it, we really need it :)

@vKarter
Copy link

vKarter commented Jul 23, 2019

Remove
res.readBody().then(() => resolve(res); });
and leave only resolve(res) helps!

@github-actions
Copy link

github-actions bot commented Apr 2, 2020

This issue has had no activity in 90 days. Please comment if it is not actually stale

@github-actions github-actions bot added the stale label Apr 2, 2020
@github-actions github-actions bot closed this as completed Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants