From de829e37e2065cd9d6e3d75b15315e28f28fad62 Mon Sep 17 00:00:00 2001 From: pomonella <39027165+pmnlla@users.noreply.github.com> Date: Tue, 26 Mar 2024 02:51:31 +0000 Subject: [PATCH] Make the namespace comparison in sources.rs case-insensitive --- src/sources.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sources.rs b/src/sources.rs index 00bd2535..17e62a3d 100644 --- a/src/sources.rs +++ b/src/sources.rs @@ -104,11 +104,13 @@ pub fn check(ctx: crate::CheckCtx<'_, ValidConfig>, sink: impl Into) }; get_org(url) }) { + // .to_lowercase() (ln. 113) enables case insensitivity, as GitHub and + // GitLab are case insensitive in regards to namespaces. if let Some(ind) = ctx .cfg .allowed_orgs .iter() - .position(|(sorgt, sorgn)| orgt == *sorgt && sorgn.value.as_str() == orgname) + .position(|(sorgt, sorgn)| orgt == *sorgt && sorgn.value.as_str().to_lowercase() == orgname.to_lowercase()) { org_hits.as_mut_bitslice().set(ind, true); diags::SourceAllowedByOrg {