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

fix: uncaught exception due to second response with digest auth #534

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: uncaught exception due to second response with digest auth
pick from #530
damiengrandi authored and fengmk2 committed Sep 14, 2024
commit 802dd96bbb0f74459953ec406fea44a790a07884
2 changes: 2 additions & 0 deletions src/HttpClient.ts
Original file line number Diff line number Diff line change
@@ -581,6 +581,8 @@ export class HttpClient extends EventEmitter {
// FIXME: merge exists cookie header
requestOptions.headers.cookie = response.headers['set-cookie'].join(';');
}
// Ensure the previous response is consumed as we re-use the same variable
await response.body.arrayBuffer();
response = await undiciRequest(requestUrl, requestOptions as UndiciRequestOption);
}
}

Unchanged files with check annotations Beta

}
let response = await task;
// console.log('after response stats: %o', httpClient.getDispatcherPoolStats());
assert.equal(httpClient.getDispatcherPoolStats()[origin].pending, 0);

Check failure on line 44 in test/keep-alive-header.test.ts

GitHub Actions / Node.js / Test (macos-latest, 22)

test/keep-alive-header.test.ts > keep-alive-header.test.ts > should handle Keep-Alive header and not throw reset error on 1s keepalive agent

TypeError: Cannot read properties of undefined (reading 'pending') ❯ test/keep-alive-header.test.ts:44:64

Check failure on line 44 in test/keep-alive-header.test.ts

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

test/keep-alive-header.test.ts > keep-alive-header.test.ts > should handle Keep-Alive header and not throw reset error on 1s keepalive agent

TypeError: Cannot read properties of undefined (reading 'pending') ❯ test/keep-alive-header.test.ts:44:64

Check failure on line 44 in test/keep-alive-header.test.ts

GitHub Actions / Node.js / Test (windows-latest, 22)

test/keep-alive-header.test.ts > keep-alive-header.test.ts > should handle Keep-Alive header and not throw reset error on 1s keepalive agent

TypeError: Cannot read properties of undefined (reading 'pending') ❯ test/keep-alive-header.test.ts:44:64
assert.equal(httpClient.getDispatcherPoolStats()[origin].connected, 1);
// console.log(response.res.socket);
assert.equal(response.status, 200);