commit 21b6b42e20192fd8a8a7c75c2d7fc394ef8ee4ee
parent 38357f6735361010d6030ebb8ebfc57fde7e1c8e
Author: Florian Dold <dold@taler.net>
Date: Thu, 3 Sep 2026 15:41:17 +0200
wallet-core: key terms-of-service acceptance on the terms version
Fetching the terms stored the HTTP ETag while the keys update stored
Taler-Terms-Version, so an accepted ToS reverted to proposed at the
next update.
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/packages/taler-util/src/http-client/exchange-client.ts b/packages/taler-util/src/http-client/exchange-client.ts
@@ -356,7 +356,7 @@ export class TalerExchangeHttpClient {
acceptLanguage?: string;
acceptFormats?: string[];
} = {},
- ): Promise<OperationOk<{ text: string }>> {
+ ): Promise<OperationOk<{ text: string; etag: string | undefined }>> {
const acceptFormats = args.acceptFormats ?? ["text/plain"];
const headers = {
Accept: formatAcceptHeader(acceptFormats),
@@ -369,6 +369,9 @@ export class TalerExchangeHttpClient {
case HttpStatusCode.Ok:
return opFixedSuccess(resp, {
text: await resp.text(),
+ // The HTTP ETag is a hash of the served document and differs per
+ // language and format; acceptance is keyed on the legal version.
+ etag: resp.headers.get("taler-terms-version") || undefined,
});
default:
return opUnknownHttpFailure(resp);
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -3812,7 +3812,7 @@ export async function getExchangeTos(
tosRes.response.headers.get("content-language") ?? "en",
tosContentType:
tosRes.response.headers.get("content-type") ?? "text/plain",
- tosEtag: tosRes.response.headers.get("etag") ?? "",
+ tosEtag: tosRes.body.etag ?? "",
tosText: tosRes.body.text,
};
},