Skip to content

Error validating download location with git+ssh URI #745

@bdehamer

Description

@bdehamer

When using git URLs to reference packages in npm, the URL often gets normalized to a form like:

git+ssh://git@github.com/foo/bar.git#b7e1e0fb20cff47bcca4be90d0c6f83a45e51e9c 

When using a URL of this form as a downloadLocation value, it fails validation due to the git@ portion of the URL.

Can the URL regex be expanded to allow for the userinfo portion of the URI?

url_pattern = (
"(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/|ssh:\\/\\/|git:\\/\\/|svn:\\/\\/|sftp:"
"\\/\\/|ftp:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+){0,100}\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?"

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