taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit dc918a3ec2b28f97d171a5df85228d87978e98e0
parent 6749a526f6c19be0b07ccf5b0efc074a381b31ea
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Sun,  1 Feb 2026 09:45:19 -0300

etag should be quoted on req headers

Diffstat:
Mpackages/taler-util/src/http-client/exchange-client.ts | 78+++++++++++++++++++++++++++++++++++++++---------------------------------------
Mpackages/taler-util/src/http-client/merchant.ts | 4++--
2 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/packages/taler-util/src/http-client/exchange-client.ts b/packages/taler-util/src/http-client/exchange-client.ts @@ -387,13 +387,13 @@ export class TalerExchangeHttpClient { ): Promise< | OperationOk<ExchangeMergeSuccessResponse> | OperationAlternative< - HttpStatusCode.UnavailableForLegalReasons, - LegitimizationNeededResponse - > + HttpStatusCode.UnavailableForLegalReasons, + LegitimizationNeededResponse + > | OperationAlternative< - HttpStatusCode.Conflict, - ExchangeMergeConflictResponse - > + HttpStatusCode.Conflict, + ExchangeMergeConflictResponse + > | OperationFail<HttpStatusCode.Forbidden> | OperationFail<HttpStatusCode.NotFound> | OperationFail<HttpStatusCode.Gone> @@ -440,9 +440,9 @@ export class TalerExchangeHttpClient { | OperationFail<HttpStatusCode.NotFound> | OperationAlternative<HttpStatusCode.Conflict, PurseConflictPartial> | OperationAlternative< - HttpStatusCode.UnavailableForLegalReasons, - LegitimizationNeededResponse - > + HttpStatusCode.UnavailableForLegalReasons, + LegitimizationNeededResponse + > > { const resp = await this.fetch(`reserves/${pursePub}/purse`, { method: "POST", @@ -695,7 +695,7 @@ export class TalerExchangeHttpClient { { method: "GET", headers: { - "If-None-Match": known.length ? known.join(",") : undefined, + "If-None-Match": known.length ? known.map(d => `"${d}"`).join(",") : undefined, }, }, longpoll, @@ -732,7 +732,7 @@ export class TalerExchangeHttpClient { const resp = await this.httpLib.fetch(url.href, { method: "GET", headers: { - "If-None-Match": etag, + "If-None-Match": !etag ? undefined : `"${etag}"`, }, }); switch (resp.status) { @@ -805,10 +805,10 @@ export class TalerExchangeHttpClient { body: object = {}, ): Promise< | OperationFail< - | HttpStatusCode.NotFound - | HttpStatusCode.Conflict - | HttpStatusCode.PayloadTooLarge - > + | HttpStatusCode.NotFound + | HttpStatusCode.Conflict + | HttpStatusCode.PayloadTooLarge + > | OperationOk<KycProcessStartInformation> > { const resp = await this.fetch(`kyc-start/${requirement}`, { @@ -867,10 +867,10 @@ export class TalerExchangeHttpClient { ): Promise< | OperationOk<AvailableMeasureSummary> | OperationFail< - | HttpStatusCode.Forbidden - | HttpStatusCode.NotFound - | HttpStatusCode.Conflict - > + | HttpStatusCode.Forbidden + | HttpStatusCode.NotFound + | HttpStatusCode.Conflict + > > { const resp = await this.fetch(`aml/${auth.id}/measures`, { method: "GET", @@ -1041,10 +1041,10 @@ export class TalerExchangeHttpClient { } = {}, ): Promise< | OperationFail< - | HttpStatusCode.Forbidden - | HttpStatusCode.NotFound - | HttpStatusCode.Conflict - > + | HttpStatusCode.Forbidden + | HttpStatusCode.NotFound + | HttpStatusCode.Conflict + > | OperationOk<AmlDecisionsResponse> > { const url = new URL(`aml/${auth.id}/decisions`, this.baseUrl); @@ -1136,10 +1136,10 @@ export class TalerExchangeHttpClient { ): Promise< | OperationOk<KycAttributes> | OperationFail< - | HttpStatusCode.Forbidden - | HttpStatusCode.NotFound - | HttpStatusCode.Conflict - > + | HttpStatusCode.Forbidden + | HttpStatusCode.NotFound + | HttpStatusCode.Conflict + > > { const url = new URL(`aml/${auth.id}/attributes/${account}`, this.baseUrl); @@ -1255,10 +1255,10 @@ export class TalerExchangeHttpClient { ): Promise< | OperationOk<ExchangeTransferList> | OperationFail< - | HttpStatusCode.Forbidden - | HttpStatusCode.NotFound - | HttpStatusCode.Conflict - > + | HttpStatusCode.Forbidden + | HttpStatusCode.NotFound + | HttpStatusCode.Conflict + > > { const url = new URL(`aml/${auth.id}/transfers-credit`, this.baseUrl); @@ -1306,10 +1306,10 @@ export class TalerExchangeHttpClient { ): Promise< | OperationOk<ExchangeTransferList> | OperationFail< - | HttpStatusCode.Forbidden - | HttpStatusCode.NotFound - | HttpStatusCode.Conflict - > + | HttpStatusCode.Forbidden + | HttpStatusCode.NotFound + | HttpStatusCode.Conflict + > > { const url = new URL(`aml/${auth.id}/transfers-debit`, this.baseUrl); @@ -1357,10 +1357,10 @@ export class TalerExchangeHttpClient { ): Promise< | OperationOk<ExchangeTransferList> | OperationFail< - | HttpStatusCode.Forbidden - | HttpStatusCode.NotFound - | HttpStatusCode.Conflict - > + | HttpStatusCode.Forbidden + | HttpStatusCode.NotFound + | HttpStatusCode.Conflict + > > { const url = new URL(`aml/${auth.id}/transfers-kycauth`, this.baseUrl); diff --git a/packages/taler-util/src/http-client/merchant.ts b/packages/taler-util/src/http-client/merchant.ts @@ -854,7 +854,7 @@ export class TalerMerchantInstanceHttpClient { break; case "state-change": url.searchParams.set("lp_not_etag", (params.longpoll.etag)); - headers["If-none-match"] = params.longpoll.etag + headers["If-none-match"] = `"${params.longpoll.etag}"` break; default: assertUnreachable(params.longpoll) } @@ -1649,7 +1649,7 @@ export class TalerMerchantInstanceHttpClient { const headers: Record<string, string> = {}; if (params.longpoll) { url.searchParams.set("lp_not_etag", (params.longpoll.etag)); - headers["If-none-match"] = params.longpoll.etag + headers["If-none-match"] = `"${params.longpoll.etag}"` url.searchParams.set("timeout_ms", String(params.longpoll.timeout)); } else { // backward compat, prefer longpoll