You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> const { PackageURL } = await import("packageurl-js");
undefined
> new PackageURL("generic", "100%", "test");
Uncaught URIError: URI malformed
at decodeURIComponent (<anonymous>)
at Object.normalizeNamespace [as normalize] (/purl/repo/src/normalize.js:16:25)
at new PackageURL (/purl/repo/src/package-url.js:50:39)
> new PackageURL("generic", "test", "100%");
Uncaught URIError: URI malformed
at decodeURIComponent (<anonymous>)
at Object.normalizeName [as normalize] (/purl/repo/src/normalize.js:10:11)
at new PackageURL (/purl/repo/src/package-url.js:55:34)
> new PackageURL("generic", "test", "test", "100%");
Uncaught URIError: URI malformed
at decodeURIComponent (<anonymous>)
at Object.normalizeVersion [as normalize] (/purl/repo/src/normalize.js:91:11)
at new PackageURL (/purl/repo/src/package-url.js:60:37)
> new PackageURL("generic", "test", "test", "1.0", {}, "100%");
Uncaught URIError: URI malformed
at decodeURIComponent (<anonymous>)
at Object.normalizeSubpath [as normalize] (/purl/repo/src/normalize.js:77:25)
at new PackageURL (/purl/repo/src/package-url.js:71:37)
Or worse if the percent sign is followed by two or more hex characters:
> new PackageURL("generic", "", "%21").toString();
'pkg:generic/!'
It only works correctly for qualifier values:
> new PackageURL("generic", "test", "test", "1.0", {"a": "100%"}).toString();
'pkg:generic/test/[email protected]?a=100%25'
The text was updated successfully, but these errors were encountered:
@matt-phylum Thanks for the find! This happens because in v2 normalization is consistent across constructor and fromString. In v1.x PackageURL.fromString("pkg:general/100%/test") would throw a similar error (because of decodeURIComponent use).
Or worse if the percent sign is followed by two or more hex characters:
It only works correctly for qualifier values:
The text was updated successfully, but these errors were encountered: