File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
packages/mongodb-memory-server-core/src/util Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ Option `DEBUG` is used to enable Debug Output
4949
5050Option ` DOWNLOAD_MIRROR ` is used to set which mirror to use
5151
52- Default / Format: ` https://fastdl.mongodb.org `
52+ Default / Format: ` https://fastdl.mongodb.org ` (protocol needs to be included)
5353
5454### DOWNLOAD_URL
5555
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import debug from 'debug';
44import * as semver from 'semver' ;
55import { isNullOrUndefined } from './utils' ;
66import { BaseDryMongoBinaryOptions , DryMongoBinary } from './DryMongoBinary' ;
7+ import { URL } from 'url' ;
78
89const log = debug ( 'MongoMS:MongoBinaryDownloadUrl' ) ;
910
@@ -39,7 +40,9 @@ export class MongoBinaryDownloadUrl {
3940 if ( downloadUrl ) {
4041 log ( `Using "${ downloadUrl } " as the Download-URL` ) ;
4142
42- return downloadUrl ;
43+ const url = new URL ( downloadUrl ) ; // check if this is an valid url
44+
45+ return url . toString ( ) ;
4346 }
4447
4548 const archive = await this . getArchiveName ( ) ;
@@ -49,7 +52,10 @@ export class MongoBinaryDownloadUrl {
4952 resolveConfig ( ResolveConfigVariables . DOWNLOAD_MIRROR ) ?? 'https://fastdl.mongodb.org' ;
5053 log ( `Using "${ mirror } " as the mirror` ) ;
5154
52- return `${ mirror } /${ this . platform } /${ archive } ` ;
55+ const url = new URL ( mirror ) ;
56+ url . pathname = `/${ this . platform } /${ archive } ` ;
57+
58+ return url . toString ( ) ;
5359 }
5460
5561 /**
You can’t perform that action at this time.
0 commit comments