Skip to content

Duplicated TLD returned by utils.get_urls (eg: "github.com.com") #20

Description

@tdruez

Initially reported at aboutcode-org/scancode.io#1753

Following investigations, the culprit is the utils.get_vcs_based_urls function.

In the function, a ".com" string is always forced even if already part of the value, see for example:

from go_inspector.binary import utils
from packageurl import PackageURL

purl_str = "pkg:golang/github.com/rclone/rclone@v1.70.3%2Bdirty"
purl = PackageURL.from_string(purl_str)

utils.get_vcs_based_urls(purl)

Results:

{'bug_tracking_url': 'https://github.com.com/rclone/rclone/issues',
 'code_view_url': 'https://github.com.com/rclone/rclone',
 'homepage_url': 'https://github.com.com/rclone/rclone',
 'vcs_url': 'git+https://github.com.com/rclone/rclone.git'}

Expected:

{'bug_tracking_url': 'https://github.com/rclone/rclone/issues',
 'code_view_url': 'https://github.com/rclone/rclone',
 'homepage_url': 'https://github.com/rclone/rclone',
 'vcs_url': 'git+https://github.com/rclone/rclone.git'}

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions