aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/exchanges.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/exchanges.ts')
-rw-r--r--packages/taler-wallet-core/src/exchanges.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
index a4732e474..4792c3c20 100644
--- a/packages/taler-wallet-core/src/exchanges.ts
+++ b/packages/taler-wallet-core/src/exchanges.ts
@@ -150,6 +150,7 @@ async function downloadExchangeWithTermsOfService(
exchangeBaseUrl: string,
http: HttpRequestLibrary,
timeout: Duration,
+ cancellationToken: CancellationToken,
acceptFormat: string,
acceptLanguage: string | undefined,
): Promise<ExchangeTosDownloadResult> {
@@ -169,6 +170,7 @@ async function downloadExchangeWithTermsOfService(
const resp = await http.fetch(reqUrl.href, {
headers,
timeout,
+ cancellationToken,
});
const tosText = await readSuccessResponseTextOrThrow(resp);
const tosEtag = resp.headers.get("etag") || "unknown";
@@ -789,6 +791,7 @@ async function downloadTosFromAcceptedFormat(
ws: InternalWalletState,
baseUrl: string,
timeout: Duration,
+ cancellationToken: CancellationToken,
acceptedFormat?: string[],
acceptLanguage?: string,
): Promise<ExchangeTosDownloadResult> {
@@ -800,6 +803,7 @@ async function downloadTosFromAcceptedFormat(
baseUrl,
ws.http,
timeout,
+ cancellationToken,
format,
acceptLanguage,
);
@@ -816,6 +820,7 @@ async function downloadTosFromAcceptedFormat(
baseUrl,
ws.http,
timeout,
+ cancellationToken,
"text/plain",
acceptLanguage,
);
@@ -1256,6 +1261,7 @@ export async function updateExchangeFromUrlHandler(
ws,
exchangeBaseUrl,
timeout,
+ cancellationToken,
["text/plain"],
);
@@ -1632,6 +1638,7 @@ export async function getExchangeTos(
ws,
exchangeBaseUrl,
getExchangeRequestTimeout(),
+ CancellationToken.CONTINUE,
acceptedFormat,
acceptLanguage,
);