Skip to content

Commit

Permalink
Merge pull request #617 from theztefan/purl-encoding-error
Browse files Browse the repository at this point in the history
Fixes purl "version must be percent-encoded"
  • Loading branch information
febuiles committed Nov 13, 2023
2 parents fde92ac + 152d8e2 commit 26f1ad9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/licenses.ts
Expand Up @@ -32,7 +32,7 @@ export async function getInvalidLicenseChanges(
const {allow, deny} = licenses
const licenseExclusions = licenses.licenseExclusions?.map(
(pkgUrl: string) => {
return PackageURL.fromString(pkgUrl)
return PackageURL.fromString(encodeURI(pkgUrl))
}
)

Expand All @@ -45,7 +45,9 @@ export async function getInvalidLicenseChanges(
return true
}

const changeAsPackageURL = PackageURL.fromString(change.package_url)
const changeAsPackageURL = PackageURL.fromString(
encodeURI(change.package_url)
)

// We want to find if the licenseExclussion list contains the PackageURL of the Change
// If it does, we want to filter it out and therefore return false
Expand Down

0 comments on commit 26f1ad9

Please sign in to comment.