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

Error validating download location with git+ssh URI #745

Closed
bdehamer opened this issue Aug 9, 2023 · 1 comment · Fixed by #746
Closed

Error validating download location with git+ssh URI #745

bdehamer opened this issue Aug 9, 2023 · 1 comment · Fixed by #746

Comments

@bdehamer
Copy link
Contributor

bdehamer commented Aug 9, 2023

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})?(\\/.*)?"

@maxhbr
Copy link
Member

maxhbr commented Aug 11, 2023

Oh Yes, this should explicitly be allowed, see spec section 7.7.

We would also be happy to support you to contribute that fix. If you want, just start creating a PR. You already found the relevant code section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants