diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-01-18 23:32:03 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-01-18 23:32:14 +0100 |
commit | af57a404d070500ce63ed9ed0dfce721e82e4801 (patch) | |
tree | 39e97aefffe61c568b64c1d71d66b48e26c905ce /src/util/taleruri-test.ts | |
parent | fcb0565323d3134ec2dc376700ef85a2c7b7becd (diff) | |
download | wallet-core-af57a404d070500ce63ed9ed0dfce721e82e4801.tar.xz |
fix and test case for "insecure" taler://refund URIs
Diffstat (limited to 'src/util/taleruri-test.ts')
-rw-r--r-- | src/util/taleruri-test.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/util/taleruri-test.ts b/src/util/taleruri-test.ts index de4a90697..052581a91 100644 --- a/src/util/taleruri-test.ts +++ b/src/util/taleruri-test.ts @@ -96,7 +96,7 @@ test("taler pay url parsing: complex path prefix", t => { t.is(r1.sessionId, undefined); }); -test("taler pay url parsing: complex path prefix and instance", t => { +test("taler pay uri parsing: complex path prefix and instance", t => { const url1 = "taler://pay/example.com/mypfx%2Fpublic/foo/myorder"; const r1 = parsePayUri(url1); if (!r1) { @@ -107,7 +107,18 @@ test("taler pay url parsing: complex path prefix and instance", t => { t.is(r1.orderId, "myorder"); }); -test("taler pay url parsing: non-https #1", t => { +test("taler refund uri parsing: non-https #1", t => { + const url1 = "taler://refund/example.com/-/-/myorder?insecure=1"; + const r1 = parseRefundUri(url1); + if (!r1) { + t.fail(); + return; + } + t.is(r1.merchantBaseUrl, "http://example.com/public/"); + t.is(r1.orderId, "myorder") +}); + +test("taler pay uri parsing: non-https #1", t => { const url1 = "taler://pay/example.com/-/-/myorder?insecure=1"; const r1 = parsePayUri(url1); if (!r1) { |