aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-06-16 17:47:29 +0200
committerFlorian Dold <florian@dold.me>2024-06-16 17:47:36 +0200
commit65f168b4d259603cb9321f19228507875da87038 (patch)
treefd80e86a4bcbe89ef7739ed68f16ce8042fa9905 /packages
parent1e2d09017fd5bd0a8b5def8a30f5a7c07e8a7156 (diff)
downloadwallet-core-65f168b4d259603cb9321f19228507875da87038.tar.xz
wallet-core: fix return value of getExchangeTos for missing ToS
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-wallet-core/src/exchanges.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
index dd88fa836..903f79dcd 100644
--- a/packages/taler-wallet-core/src/exchanges.ts
+++ b/packages/taler-wallet-core/src/exchanges.ts
@@ -2122,6 +2122,19 @@ export async function getExchangeTos(
): Promise<GetExchangeTosResult> {
const exch = await fetchFreshExchange(wex, exchangeBaseUrl);
+ switch (exch.tosStatus) {
+ case ExchangeTosStatus.MissingTos:
+ return {
+ tosStatus: ExchangeTosStatus.MissingTos,
+ acceptedEtag: undefined,
+ contentLanguage: undefined,
+ contentType: "text/plain",
+ content: "NULL",
+ currentEtag: "NULL",
+ tosAvailableLanguages: [],
+ };
+ }
+
const tosDownload = await downloadTosFromAcceptedFormat(
wex,
exchangeBaseUrl,