From f1008c966191f5b1d3bf1f7ea8af4fbba4380b46 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 28 Jun 2023 09:49:29 -0300 Subject: use default http timeout from util --- packages/web-util/src/utils/http-impl.browser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/web-util/src/utils/http-impl.browser.ts') diff --git a/packages/web-util/src/utils/http-impl.browser.ts b/packages/web-util/src/utils/http-impl.browser.ts index a46e8d63f..598146149 100644 --- a/packages/web-util/src/utils/http-impl.browser.ts +++ b/packages/web-util/src/utils/http-impl.browser.ts @@ -22,6 +22,7 @@ import { RequestThrottler, TalerErrorCode, TalerError, + Duration, } from "@gnu-taler/taler-util"; import { @@ -31,6 +32,7 @@ import { Headers, getDefaultHeaders, encodeBody, + DEFAULT_REQUEST_TIMEOUT_MS, } from "@gnu-taler/taler-util/http"; const logger = new Logger("browserHttpLib"); @@ -50,7 +52,8 @@ export class BrowserHttpLib implements HttpRequestLibrary { const requestMethod = options?.method ?? "GET"; const requestBody = options?.body; const requestHeader = options?.headers; - const requestTimeout = options?.timeout ?? { d_ms: 2 * 1000 }; + const requestTimeout = + options?.timeout ?? Duration.fromMilliseconds(DEFAULT_REQUEST_TIMEOUT_MS); if (this.throttlingEnabled && this.throttle.applyThrottle(requestUrl)) { const parsedUrl = new URL(requestUrl); -- cgit v1.2.3