Skip to content

Commit

Permalink
fix(MongoBinaryDownload): getDownloadUrl: allow DOWNLOAD_MIRROR to ad…
Browse files Browse the repository at this point in the history
…d extra paths

fixes #512
  • Loading branch information
hasezoey committed Jul 24, 2021
1 parent e77f010 commit ae7ddab
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
log(`Using "${mirror}" as the mirror`);

const url = new URL(mirror);
url.pathname = `/${this.platform}/${archive}`;

// ensure that the "mirror" path ends with "/"
if (!url.pathname.endsWith('/')) {
url.pathname = url.pathname + '/';
}

// no extra "/" between "pathname" and "platfrom", because of the "if" statement above to ensure "url.pathname" to end with "/"
url.pathname = `${url.pathname}${this.platform}/${archive}`;

return url.toString();
}
Expand Down

0 comments on commit ae7ddab

Please sign in to comment.