fix: NPM redis.js CPE (#5012)

Signed-off-by: Rez Moss <hi@rezmoss.com>
This commit is contained in:
Rez Moss 2026-07-15 20:55:42 -04:00 committed by GitHub
parent aff2c247db
commit 8ed534c32b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -221,6 +221,11 @@ var defaultCandidateAdditions = buildCandidateLookup(
candidateKey{PkgName: "mustache"}, candidateKey{PkgName: "mustache"},
candidateAddition{AdditionalProducts: []string{"mustache.js"}}, candidateAddition{AdditionalProducts: []string{"mustache.js"}},
}, },
{
pkg.NpmPkg,
candidateKey{PkgName: "redis"},
candidateAddition{AdditionalVendors: []string{"redis.js"}},
},
// Gem packages // Gem packages
{ {

View File

@ -147,6 +147,14 @@ func Test_additionalVendors(t *testing.T) {
vendor: "my-vendor", vendor: "my-vendor",
expected: []string{"awesome-vendor-addition", "one-good-addition", "another-good-addition"}, expected: []string{"awesome-vendor-addition", "one-good-addition", "another-good-addition"},
}, },
{
name: "default additionsnpm redis gets redisjs vendor",
allAdditions: defaultCandidateAdditions,
ty: pkg.NpmPkg,
pkgName: "redis",
vendor: "redis",
expected: []string{"redis.js"},
},
} }
for _, test := range tests { for _, test := range tests {
t.Run(test.name, func(t *testing.T) { t.Run(test.name, func(t *testing.T) {