packageurl-js
packageurl-js copied to clipboard
Fix issues #58 & #63
- Fix issue https://github.com/package-url/packageurl-js/issues/58 - Incorrect parsing of PURLs beginning with
pkg:// - Fix issue https://github.com/package-url/packageurl-js/issues/63 - Incorrect parsing of PURL with leading '/' in namespace
Fix Description
- strip /, // and /// as possible in pkg:/ or pkg:// or pkg:/// before passing into URL constructor
- filter for non-empty items in
namespaceComponents
@steven-esser Please review this
@matt-phylum please review this
@pombredanne, @steven-esser Can you please review this PR
I cannot reproduce #58 on master branch.
PackageURL.fromString('pkg://maven/org.apache.commons/io')
outputs
{
"type": "maven",
"name": "io",
"namespace": "org.apache.commons",
"version": null,
"qualifiers": null,
"subpath": null
}
Are you sure? That is not the behavior I get on the master branch (commit aa6d185251e3ec4e6fbc80489374c5fede9ccca1).
> PackageURL.fromString('pkg://maven/org.apache.commons/io')
PackageURL {
type: 'maven',
name: 'io',
namespace: null,
version: null,
qualifiers: null,
subpath: null
}
Ah, my bad!
Closing as covered by https://github.com/package-url/packageurl-js/pull/71