mirror of
https://github.com/modrinth/code.git
synced 2026-08-27 01:54:47 +00:00
fix: packs not being validated correctly (#6533)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user