Skip to content

Commit bbe390e

Browse files
committed
Decode purls
1 parent 7c3b372 commit bbe390e

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

dist/index.js

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,12 @@ function getManifestFromSpdxFile(document, fileName) {
4747
if (purl == null || purl == undefined) {
4848
purl = `pkg:generic/${packageName}@${packageVersion}`;
4949
}
50-
//Working around a character encoding issue I'm seeing from a Microsoft SBOM generator.
51-
purl = decodeURI(purl);
5250

5351
let relationships = document.relationships?.find(rel => rel.relatedSpdxElement == pkg.SPDXID && rel.relationshipType == "DEPENDS_ON" && rel.spdxElementId != "SPDXRef-RootPackage");
5452
if (relationships != null && relationships.length > 0) {
55-
manifest.addIndirectDependency(new Package(purl));
53+
manifest.addIndirectDependency(new Package(decodeURI(purl)));
5654
} else {
57-
manifest.addDirectDependency(new Package(purl));
55+
manifest.addDirectDependency(new Package(decodeURI(purl)));
5856
}
5957
});
6058
return manifest;

0 commit comments

Comments
 (0)