Skip to content
13 changes: 9 additions & 4 deletions apps/labrinth/src/routes/maven.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ fn find_file<'a>(
version: &'a VersionQueryResult,
file: &str,
) -> Option<&'a FileQueryResult> {
if let Some(selected_file) =
version.files.iter().find(|x| x.filename == file)
if let Some(selected_file) = version
.files
.iter()
.find(|x| x.filename.eq_ignore_ascii_case(file))
{
return Some(selected_file);
}
Expand All @@ -259,7 +261,10 @@ 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()
Expand Down Expand Up @@ -313,7 +318,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"
Expand Down