mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 00:46:38 +01:00
fix: update license content filtering default case to be 'none' for no content returned
--------- Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -365,7 +365,7 @@ func (b *licenseBuilder) licensesFromEvidenceAndContent(evidence []licenses.Evid
|
||||
|
||||
func (b *licenseBuilder) licenseFromContentHash(content string) License {
|
||||
hash := sha256HexFromString(content)
|
||||
value := "LicenseRef-sha256:" + hash
|
||||
value := "sha256:" + hash
|
||||
|
||||
return License{
|
||||
Value: value,
|
||||
|
||||
@@ -149,7 +149,7 @@ func TestLicenseSet_Add(t *testing.T) {
|
||||
Locations: file.NewLocationSet(),
|
||||
},
|
||||
{
|
||||
Value: "LicenseRef-sha256:eebcea3ab1d1a28e671de90119ffcfb35fe86951e4af1b17af52b7a82fcf7d0a",
|
||||
Value: "sha256:eebcea3ab1d1a28e671de90119ffcfb35fe86951e4af1b17af52b7a82fcf7d0a",
|
||||
Contents: readFileAsString("../../internal/licenses/test-fixtures/nvidia-software-and-cuda-supplement"),
|
||||
Type: license.Declared,
|
||||
},
|
||||
|
||||
@@ -255,7 +255,7 @@ func TestFullText(t *testing.T) {
|
||||
name: "Full Text field is populated with the correct full text and contents are given a sha256 as value",
|
||||
value: fullText,
|
||||
want: License{
|
||||
Value: "LicenseRef-sha256:108067fa71229a2b98b9696af0ce21cd11d9639634c8bc94bda70ebedf291e5a",
|
||||
Value: "sha256:108067fa71229a2b98b9696af0ce21cd11d9639634c8bc94bda70ebedf291e5a",
|
||||
Type: license.Declared,
|
||||
Contents: fullText,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user