Skip to content

Commit

Permalink
Make the namespace comparison in sources.rs case-insensitive (#643)
Browse files Browse the repository at this point in the history
Fixed #629. The primary reason for this PR is documented there, as well.
  • Loading branch information
pmnlla authored Mar 26, 2024
1 parent 31720e5 commit bb7d86b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ pub fn check(ctx: crate::CheckCtx<'_, ValidConfig>, sink: impl Into<ErrorSink>)
};
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 {
Expand Down

0 comments on commit bb7d86b

Please sign in to comment.