Skip to content

url2purl returns incorrect version and unexpected subpath for GitHub commit URLs #210

Description

@ziadhany

version should be the commit SHA: 98e516011d6e096e25247b82fc5f196bbeecff10, The subpath must be empty.

Actual Output

>>> from packageurl.contrib.url2purl import url2purl
>>> purl = url2purl("https://github.com/aboutcode-org/vulnerablecode/commit/98e516011d6e096e25247b82fc5f196bbeecff10")
>>> purl
PackageURL(type='github', namespace='aboutcode-org', name='vulnerablecode', version='commit', qualifiers={}, subpath='98e516011d6e096e25247b82fc5f196bbeecff10')

Expected PackageURL:

>>> purl
PackageURL(type='github', namespace='aboutcode-org', name='vulnerablecode', version='98e516011d6e096e25247b82fc5f196bbeecff10', qualifiers={}, subpath='')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions