mirror of
https://github.com/denoland/deno.git
synced 2025-10-01 14:41:15 +00:00
fix(cli/fetch): fix relative redirect (#6715)
This commit is contained in:
parent
ac000341db
commit
4aeac64ecd
4 changed files with 43 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue