diff options
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/http-impl.node.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/taler-util/src/http-impl.node.ts b/packages/taler-util/src/http-impl.node.ts index fe2da891c..b9c007b35 100644 --- a/packages/taler-util/src/http-impl.node.ts +++ b/packages/taler-util/src/http-impl.node.ts @@ -19,9 +19,9 @@ /** * Imports. */ -import * as http from "node:http"; -import * as https from "node:https"; import * as net from "node:net"; +import type { ClientRequest, IncomingMessage } from "node:http"; +import { RedirectableRequest, http, https } from "follow-redirects"; import { RequestOptions } from "node:http"; import { TalerError } from "./errors.js"; import { encodeBody, getDefaultHeaders, HttpLibArgs } from "./http-common.js"; @@ -177,7 +177,7 @@ export class HttpLibImpl implements HttpRequestLibrary { } return new Promise((resolve, reject) => { - const handler = (res: http.IncomingMessage) => { + const handler = (res: IncomingMessage) => { res.on("data", (d) => { chunks.push(d); }); @@ -227,7 +227,7 @@ export class HttpLibImpl implements HttpRequestLibrary { }); }; - let req: http.ClientRequest; + let req: RedirectableRequest<ClientRequest, IncomingMessage>; if (options.protocol === "http:") { req = http.request(options, handler); } else if (options.protocol === "https:") { |