mirror of
https://github.com/anchore/syft.git
synced 2026-05-20 04:05:24 +02:00
fix: map "nuget" purl type to DotnetPkg in TypeByName (#4848)
Signed-off-by: Chris (ChrisJr404) <11917633+ChrisJr404@users.noreply.github.com>
This commit is contained in:
parent
8cb78ce40c
commit
b5f0877967
@ -220,7 +220,7 @@ func TypeByName(name string) Type {
|
||||
return CondaPkg
|
||||
case packageurl.TypePub:
|
||||
return DartPubPkg
|
||||
case "dotnet": // here to support legacy use cases
|
||||
case "dotnet", packageurl.TypeNuget: // "dotnet" is here to support legacy use cases; "nuget" is the canonical purl type
|
||||
return DotnetPkg
|
||||
case packageurl.TypeCocoapods:
|
||||
return CocoapodsPkg
|
||||
|
||||
@ -58,6 +58,11 @@ func TestTypeFromPURL(t *testing.T) {
|
||||
purl: "pkg:dotnet/Microsoft.CodeAnalysis.Razor@2.2.0",
|
||||
expected: DotnetPkg,
|
||||
},
|
||||
{
|
||||
name: "nuget purl maps to dotnet",
|
||||
purl: "pkg:nuget/Minio@7.0.0",
|
||||
expected: DotnetPkg,
|
||||
},
|
||||
{
|
||||
purl: "pkg:composer/laravel/laravel@5.5.0",
|
||||
expected: PhpComposerPkg,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user