From fb3aee71c1dcb371e0c1826d8327e4ff73c514ec Mon Sep 17 00:00:00 2001 From: Zefir Kirilov Date: Tue, 16 Dec 2025 16:25:14 +0200 Subject: [PATCH 1/2] Make Maven file resolution case-insensitive --- apps/labrinth/src/routes/maven.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/labrinth/src/routes/maven.rs b/apps/labrinth/src/routes/maven.rs index 878f6dabcc..2ab96b2279 100644 --- a/apps/labrinth/src/routes/maven.rs +++ b/apps/labrinth/src/routes/maven.rs @@ -242,7 +242,7 @@ fn find_file<'a>( file: &str, ) -> Option<&'a FileQueryResult> { if let Some(selected_file) = - version.files.iter().find(|x| x.filename == file) + version.files.iter().find(|x| x.filename.eq_ignore_ascii_case(file)) { return Some(selected_file); } @@ -259,7 +259,7 @@ fn find_file<'a>( } for fileext in fileexts { - if file == format!("{}-{}.{}", &project_id, &vcoords, fileext) { + if file.eq_ignore_ascii_case(format!("{}-{}.{}", &project_id, &vcoords, fileext)) { return version .files .iter() @@ -313,7 +313,7 @@ pub async fn version_file( return Err(ApiError::NotFound); } - if file == format!("{}-{}.pom", &project_id, &vnum) { + if file.eq_ignore_ascii_case(format!("{}-{}.pom", &project_id, &vnum)) { let respdata = MavenPom { schema_location: "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" From 45f34fb81a420850e23b97b093b9d3be58d0ef15 Mon Sep 17 00:00:00 2001 From: Zefir Kirilov Date: Fri, 19 Dec 2025 10:00:13 +0200 Subject: [PATCH 2/2] fix string reference --- apps/labrinth/src/routes/maven.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/labrinth/src/routes/maven.rs b/apps/labrinth/src/routes/maven.rs index 2ab96b2279..9f19ac4b6a 100644 --- a/apps/labrinth/src/routes/maven.rs +++ b/apps/labrinth/src/routes/maven.rs @@ -259,7 +259,7 @@ fn find_file<'a>( } for fileext in fileexts { - if file.eq_ignore_ascii_case(format!("{}-{}.{}", &project_id, &vcoords, fileext)) { + if file.eq_ignore_ascii_case(&format!("{}-{}.{}", &project_id, &vcoords, fileext)) { return version .files .iter() @@ -313,7 +313,7 @@ pub async fn version_file( return Err(ApiError::NotFound); } - if file.eq_ignore_ascii_case(format!("{}-{}.pom", &project_id, &vnum)) { + if file.eq_ignore_ascii_case(&format!("{}-{}.pom", &project_id, &vnum)) { let respdata = MavenPom { schema_location: "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"