diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2020-07-13 06:53:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-13 00:53:36 -0400 |
commit | 4aeac64ecd82d5953bdb92916248f5f7352be4f4 (patch) | |
tree | 902111fada801eafc41141d68d865e1ce0ccafa9 /cli/tests/unit/url_test.ts | |
parent | ac000341db0c90012a6330f66bd7bebe44c9c872 (diff) |
fix(cli/fetch): fix relative redirect (#6715)
Diffstat (limited to 'cli/tests/unit/url_test.ts')
-rw-r--r-- | cli/tests/unit/url_test.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/unit/url_test.ts b/cli/tests/unit/url_test.ts index 177f605c1..3e7ac6214 100644 --- a/cli/tests/unit/url_test.ts +++ b/cli/tests/unit/url_test.ts @@ -240,6 +240,19 @@ unitTest(function urlBaseURL(): void { ); const url = new URL("/foo/bar?baz=foo#qux", base); assertEquals(url.href, "https://foo:bar@baz.qat:8000/foo/bar?baz=foo#qux"); + + assertEquals( + new URL("D", "https://foo.bar/path/a/b/c/d").href, + "https://foo.bar/path/a/b/c/D" + ); + + assertEquals(new URL("D", "https://foo.bar").href, "https://foo.bar/D"); + assertEquals(new URL("D", "https://foo.bar/").href, "https://foo.bar/D"); + + assertEquals( + new URL("/d", "https://foo.bar/path/a/b/c/d").href, + "https://foo.bar/d" + ); }); unitTest(function urlBaseString(): void { |