Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PURLs containing multiple namespaces segments parse incorrectly #5

Closed
matt-phylum opened this issue Nov 8, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@matt-phylum
Copy link

matt-phylum commented Nov 8, 2023

The PURL test suite contains the PURL pkg:swift/github.com/Alamofire/Alamofire@5.4.3. perl-URI-PackageURL parses it as namespace github.com name Alamofire/Alamofire but it should be namespace github.com/Alamofire name Alamofire.

It also serializes incorrectly. The slash in the package name is not escaped, so serializing the incorrectly parsed PURL results in the original string again, even though it was constructed from a PURL structure that should have a different meaning.

@giterlizzi giterlizzi added the bug Something isn't working label Nov 9, 2023
giterlizzi added a commit that referenced this issue Nov 9, 2023
- Improved validation during encode and decode "purl" string
- Fixed CPAN repository URL
- FIX Qualifiers are case sensitive (#4)
- FIX PURLs containing multiple namespaces segments parse incorrectly (#5)
- FIX Incorrect parsing of PURLs that begin with "pkg:/" (#6)
- Improved "t/99-official-purl-test-suite.t" test
@giterlizzi
Copy link
Owner

FIXED in last release of URI::PackageURL

$ purl-tool pkg:swift/github.com/Alamofire/Alamofire@5.4.3 --env
PURL="pkg:swift/github.com/Alamofire/Alamofire@5.4.3"
PURL_TYPE="swift"
PURL_NAMESPACE="github.com/Alamofire"
PURL_NAME="Alamofire"
PURL_VERSION="5.4.3"
PURL_SUBPATH=""
PURL_QUALIFIERS=""

Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants