Skip to content

Commit 2a14edf

Browse files
Respect UV_INSECURE_NO_ZIP_VALIDATION=1 in duplicate header errors (#15912)
## Summary This was just an oversight on these specific returns. Closes #15871.
1 parent dea1700 commit 2a14edf

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

crates/uv-extract/src/stream.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,11 @@ pub async fn unzip<R: tokio::io::AsyncRead + Unpin>(
206206

207207
// Verify that the existing file contents match the expected contents.
208208
if existing_contents != expected_contents {
209-
return Err(Error::DuplicateLocalFileHeader {
210-
path: relpath.clone(),
211-
});
209+
if !skip_validation {
210+
return Err(Error::DuplicateLocalFileHeader {
211+
path: relpath.clone(),
212+
});
213+
}
212214
}
213215

214216
(bytes_read as u64, entry_reader)
@@ -455,9 +457,11 @@ pub async fn unzip<R: tokio::io::AsyncRead + Unpin>(
455457
}
456458
std::collections::hash_map::Entry::Occupied(entry) => {
457459
if mode != *entry.get() {
458-
return Err(Error::DuplicateExecutableFileHeader {
459-
path: relpath.clone(),
460-
});
460+
if !skip_validation {
461+
return Err(Error::DuplicateExecutableFileHeader {
462+
path: relpath.clone(),
463+
});
464+
}
461465
}
462466
}
463467
}

0 commit comments

Comments
 (0)