Skip to content

Commit 26f1ad9

Browse files
author
Federico Builes
authored
Merge pull request #617 from theztefan/purl-encoding-error
Fixes purl "version must be percent-encoded"
2 parents fde92ac + 152d8e2 commit 26f1ad9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Diff for: dist/index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/licenses.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function getInvalidLicenseChanges(
3232
const {allow, deny} = licenses
3333
const licenseExclusions = licenses.licenseExclusions?.map(
3434
(pkgUrl: string) => {
35-
return PackageURL.fromString(pkgUrl)
35+
return PackageURL.fromString(encodeURI(pkgUrl))
3636
}
3737
)
3838

@@ -45,7 +45,9 @@ export async function getInvalidLicenseChanges(
4545
return true
4646
}
4747

48-
const changeAsPackageURL = PackageURL.fromString(change.package_url)
48+
const changeAsPackageURL = PackageURL.fromString(
49+
encodeURI(change.package_url)
50+
)
4951

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

0 commit comments

Comments
 (0)