From 4d232fd56510ae69b76fef4f4ecade1e0d4b230d Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 5 Oct 2022 11:11:51 +0200 Subject: wallet-core: canonicalize base URL from bank on withdrawal --- packages/taler-wallet-core/src/operations/withdraw.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts') diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index e7760174e..143f9ce33 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -1844,6 +1844,10 @@ export async function acceptWithdrawalFromUri( restrictAge?: number; }, ): Promise { + const selectedExchange = canonicalizeBaseUrl(req.selectedExchange); + logger.info( + `accepting withdrawal via ${req.talerWithdrawUri}, canonicalized selected exchange ${selectedExchange}`, + ); const existingWithdrawalGroup = await ws.db .mktx((x) => [x.withdrawalGroups]) .runReadOnly(async (tx) => { @@ -1870,14 +1874,14 @@ export async function acceptWithdrawalFromUri( }; } - await updateExchangeFromUrl(ws, req.selectedExchange); + await updateExchangeFromUrl(ws, selectedExchange); const withdrawInfo = await getBankWithdrawalInfo( ws.http, req.talerWithdrawUri, ); const exchangePaytoUri = await getExchangePaytoUri( ws, - req.selectedExchange, + selectedExchange, withdrawInfo.wireTypes, ); -- cgit v1.2.3