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/js/web/fetch.ts | |
parent | ac000341db0c90012a6330f66bd7bebe44c9c872 (diff) |
fix(cli/fetch): fix relative redirect (#6715)
Diffstat (limited to 'cli/js/web/fetch.ts')
-rw-r--r-- | cli/js/web/fetch.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/cli/js/web/fetch.ts b/cli/js/web/fetch.ts index 543560c8d..d692b83e1 100644 --- a/cli/js/web/fetch.ts +++ b/cli/js/web/fetch.ts @@ -342,11 +342,7 @@ export async function fetch( !redirectUrl.startsWith("http://") && !redirectUrl.startsWith("https://") ) { - redirectUrl = - url.split("//")[0] + - "//" + - url.split("//")[1].split("/")[0] + - redirectUrl; // TODO: handle relative redirection more gracefully + redirectUrl = new URL(redirectUrl, url).href; } url = redirectUrl; redirected = true; |