aboutsummaryrefslogtreecommitdiff
path: root/src/util/taleruri.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/taleruri.ts')
-rw-r--r--src/util/taleruri.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util/taleruri.ts b/src/util/taleruri.ts
index 7e64dd4ca..fd2cca6ce 100644
--- a/src/util/taleruri.ts
+++ b/src/util/taleruri.ts
@@ -40,13 +40,11 @@ export interface TipUriResult {
* Return undefined if not passed a valid URI.
*/
export function parseWithdrawUri(s: string): WithdrawUriResult | undefined {
- const pfx = "taler://withdraw/";
- if (!s.toLowerCase().startsWith(pfx)) {
+ const pi = parseProtoInfo(s, "withdraw");
+ if (!pi) {
return undefined;
}
-
- const rest = s.substring(pfx.length);
- const parts = rest.split("/");
+ const parts = pi.rest.split("/");
if (parts.length < 2) {
return undefined;
@@ -58,7 +56,7 @@ export function parseWithdrawUri(s: string): WithdrawUriResult | undefined {
const p = [host, ...pathSegments].join("/");
return {
- bankIntegrationApiBaseUrl: `https://${p}/`,
+ bankIntegrationApiBaseUrl: `${pi.innerProto}://${p}/`,
withdrawalOperationId: withdrawId,
};
}