diff options
author | Florian Dold <florian@dold.me> | 2024-06-30 23:44:15 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-06-30 23:44:15 +0200 |
commit | 023b8f576b22155bf6116f0fed19aa4c7c1397c9 (patch) | |
tree | ea8e7fd4d2e79e8d4be32e8824075b96c0641186 | |
parent | ac268c9215a4eafd882aa174b565dc90960941f0 (diff) | |
download | wallet-core-023b8f576b22155bf6116f0fed19aa4c7c1397c9.tar.xz |
wallet-core: use taler-terms-version header instead of etag
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-merchant-categories.ts | 11 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/exchanges.ts | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-merchant-categories.ts b/packages/taler-harness/src/integrationtests/test-merchant-categories.ts index a6ddc31e2..7bf96a723 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-categories.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-categories.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { URL } from "@gnu-taler/taler-util"; +import { URL, j2s } from "@gnu-taler/taler-util"; import { ExchangeService, GlobalTestState, @@ -97,6 +97,15 @@ export async function runMerchantCategoriesTest(t: GlobalTestState) { console.log("status", res.status); console.log(await res.json()); t.assertTrue(res.status >= 200 && res.status < 300); + + { + const posUrl = new URL("private/pos", merchant.makeInstanceBaseUrl()); + const res = await harnessHttpLib.fetch(posUrl.href, { + method: "GET", + }); + const posJson = await res.json(); + console.log(j2s(posJson)); + } } runMerchantCategoriesTest.suites = ["merchant"]; diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts index ab3f95214..04f4b27eb 100644 --- a/packages/taler-wallet-core/src/exchanges.ts +++ b/packages/taler-wallet-core/src/exchanges.ts @@ -195,7 +195,7 @@ async function downloadExchangeWithTermsOfService( cancellationToken: wex.cancellationToken, }); const tosText = await readSuccessResponseTextOrThrow(resp); - const tosEtag = resp.headers.get("etag") || "unknown"; + const tosEtag = resp.headers.get("taler-terms-version") || "unknown"; const tosContentLanguage = resp.headers.get("content-language") || undefined; const tosContentType = resp.headers.get("content-type") || "text/plain"; const availLangStr = resp.headers.get("avail-languages") || ""; @@ -907,7 +907,7 @@ async function downloadTosMeta( throwUnexpectedRequestError(resp, await readTalerErrorResponse(resp)); } - const etag = resp.headers.get("etag") || "unknown"; + const etag = resp.headers.get("taler-terms-version") || "unknown"; return { type: "ok", etag, |