fix: packs not being validated correctly (#6533)

This commit is contained in:
ThatGravyBoat
2026-06-30 14:02:58 +00:00
committed by GitHub
parent b667b3ae9e
commit b569354793
7 changed files with 27 additions and 34 deletions
+8 -7
View File
@@ -326,9 +326,10 @@ fn game_version_supported(
}
}
pub fn filter_out_packs(
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
) -> Result<ValidationResult, ValidationError> {
#[must_use]
pub fn validate_pack_formats(
archive: &mut ZipArchive<Cursor<Bytes>>,
) -> ValidationResult {
if (archive.by_name("modlist.html").is_ok()
&& archive.by_name("manifest.json").is_ok())
|| archive
@@ -338,10 +339,10 @@ pub fn filter_out_packs(
.file_names()
.any(|x| x.starts_with("override/mods/") && x.ends_with(".jar"))
{
return Ok(ValidationResult::Warning(
"Invalid modpack file. You must upload a valid .MRPACK file.",
));
return ValidationResult::Warning(
"Invalid modpack file. Modpacks must be uploaded in the .mrpack format, not as a ZIP file.",
);
}
Ok(ValidationResult::Pass)
ValidationResult::Pass
}