Skip to content

Commit 54d61f3

Browse files
authored
make license allowlist matching case insensitive (google#672)
this just makes it easier for our users to use.
1 parent 521f59c commit 54d61f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/osvscanner/vulnerability_result.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package osvscanner
33
import (
44
"fmt"
55
"sort"
6+
"strings"
67

78
"github.com/google/osv-scanner/internal/sourceanalysis"
89
"github.com/google/osv-scanner/pkg/grouper"
@@ -66,10 +67,10 @@ func buildVulnerabilityResults(
6667
pkg.Licenses = licensesResp[i]
6768
allowlist := make(map[string]bool)
6869
for _, license := range licensesAllowlist {
69-
allowlist[license] = true
70+
allowlist[strings.ToLower(license)] = true
7071
}
7172
for _, license := range pkg.Licenses {
72-
if !allowlist[string(license)] {
73+
if !allowlist[strings.ToLower(string(license))] {
7374
pkg.LicenseViolations = append(pkg.LicenseViolations, license)
7475
}
7576
}

0 commit comments

Comments
 (0)