diff --git a/src/HttpClient.ts b/src/HttpClient.ts index 02cd496..8852588 100644 --- a/src/HttpClient.ts +++ b/src/HttpClient.ts @@ -562,6 +562,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); } }