mirror of
https://github.com/anchore/syft
synced 2024-11-10 14:24:12 +00:00
fix: PURLs with "nuget" type are dotnet packages (#2466)
Otherwise, Grype won't match on well-formed .NET purls from other SBOM tools. Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
parent
0e5fb8e01f
commit
7c67df397e
2 changed files with 5 additions and 1 deletions
|
@ -80,7 +80,7 @@ func LanguageByName(name string) Language {
|
|||
return Rust
|
||||
case packageurl.TypePub, string(DartPubPkg), string(Dart):
|
||||
return Dart
|
||||
case packageurl.TypeDotnet:
|
||||
case packageurl.TypeDotnet, packageurl.TypeNuget:
|
||||
return Dotnet
|
||||
case packageurl.TypeCocoapods, packageurl.TypeSwift, string(CocoapodsPkg), string(SwiftPkg):
|
||||
return Swift
|
||||
|
|
|
@ -38,6 +38,10 @@ func TestLanguageFromPURL(t *testing.T) {
|
|||
purl: "pkg:dotnet/Microsoft.CodeAnalysis.Razor@2.2.0",
|
||||
want: Dotnet,
|
||||
},
|
||||
{
|
||||
purl: "pkg:nuget/Newtonsoft.Json@13.0.0",
|
||||
want: Dotnet,
|
||||
},
|
||||
{
|
||||
purl: "pkg:cargo/clap@2.33.0",
|
||||
want: Rust,
|
||||
|
|
Loading…
Reference in a new issue