File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
packages/mongodb-memory-server-core/src/util Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -196,18 +196,18 @@ export class MongoBinaryDownload {
196196 return undefined ;
197197 }
198198
199- const mongoDBArchiveMd5 = await this . download ( urlForReferenceMD5 ) ;
200- const signatureContent = ( await fspromises . readFile ( mongoDBArchiveMd5 ) ) . toString ( 'utf-8' ) ;
199+ const archiveMD5Path = await this . download ( urlForReferenceMD5 ) ;
200+ const signatureContent = ( await fspromises . readFile ( archiveMD5Path ) ) . toString ( 'utf-8' ) ;
201201 const regexMatch = signatureContent . match ( / ^ \s * ( [ \w \d ] + ) \s * / i) ;
202- const md5Remote = regexMatch ? regexMatch [ 1 ] : null ;
203- const md5Local = md5File . sync ( mongoDBArchive ) ;
204- log ( `makeMD5check: Local MD5: ${ md5Local } , Remote MD5: ${ md5Remote } ` ) ;
202+ const md5SigRemote = regexMatch ? regexMatch [ 1 ] : null ;
203+ const md5SigLocal = md5File . sync ( mongoDBArchive ) ;
204+ log ( `makeMD5check: Local MD5: ${ md5SigLocal } , Remote MD5: ${ md5SigRemote } ` ) ;
205205
206- if ( md5Remote !== md5Local ) {
207- throw new Md5CheckFailedError ( md5Local , md5Remote || 'unknown' ) ;
206+ if ( md5SigRemote !== md5SigLocal ) {
207+ throw new Md5CheckFailedError ( md5SigLocal , md5SigRemote || 'unknown' ) ;
208208 }
209209
210- await fspromises . unlink ( mongoDBArchiveMd5 ) ;
210+ await fspromises . unlink ( archiveMD5Path ) ;
211211
212212 return true ;
213213 }
You can’t perform that action at this time.
0 commit comments