diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-08 04:08:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-08 04:08:24 +0100 |
commit | 2c72e8d5f45f12948310c1f0e1e2ed4f1d80fb51 (patch) | |
tree | 2e49ff4d7712477f8055c1d178158877f3144d34 /cli/lockfile.rs | |
parent | ed521850af98c76698316c4aa20676973e1f9afa (diff) |
fix(lock): only store integrities for http: and https: imports (#16558)
Diffstat (limited to 'cli/lockfile.rs')
-rw-r--r-- | cli/lockfile.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cli/lockfile.rs b/cli/lockfile.rs index cdb40c530..d9d0c6d85 100644 --- a/cli/lockfile.rs +++ b/cli/lockfile.rs @@ -222,6 +222,9 @@ impl Lockfile { specifier: &str, code: &str, ) -> bool { + if !(specifier.starts_with("http:") || specifier.starts_with("https:")) { + return true; + } if self.overwrite { // In case --lock-write is specified check always passes self.insert(specifier, code); @@ -247,9 +250,6 @@ impl Lockfile { /// Checks the given module is included, if so verify the checksum. If module /// is not included, insert it. fn check_or_insert(&mut self, specifier: &str, code: &str) -> bool { - if specifier.starts_with("file:") { - return true; - } if let Some(lockfile_checksum) = self.content.remote.get(specifier) { let compiled_checksum = crate::checksum::gen(&[code.as_bytes()]); lockfile_checksum == &compiled_checksum @@ -260,9 +260,6 @@ impl Lockfile { } fn insert(&mut self, specifier: &str, code: &str) { - if specifier.starts_with("file:") { - return; - } let checksum = crate::checksum::gen(&[code.as_bytes()]); self.content.remote.insert(specifier.to_string(), checksum); self.has_content_changed = true; |