-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Support parsing url with ssh protocol in url.URL. #36172
Comments
For reference, in Chromium DevTools, it is parsed as: URL {
hash: ""
host: ""
hostname: ""
href: "ssh://git@github.com:nodejs/node.git"
origin: "null"
password: ""
pathname: "//git@github.com:nodejs/node.git"
port: ""
protocol: "ssh:"
search: ""
searchParams: URLSearchParams {}
username: ""
} In Firefox, it throws In Safari, it throws |
So this is actually a limitation of the WHATWG URL parse algorithm, which the Chrome parser is actually not fully compliant to. What I would recommend here is opening an issue in the https://github.com/whatwg/url repo to see what can be done about this in the standard. Once it is addressed there (if it is addressed there) we can look at fixing it here. |
This would be considered a bug in Chrome. Glad that Firefox, Safari, and Node.js all seem to do the correct thing. |
This was great finding for Chrome and we can close this issue as wrong repository. To continue the discussion if URL should support ssh protocol, we can move to https://github.com/whatwg/url as @jasnell recommended. Thank you! |
The
URL
method cannot parse URLs formatted likessh://git@github.com:nodejs/node.git
, because the:nodejs
part is regarded as an invalid port number, but in Google Chrome, the url is able to be parsed, the:nodejs
part is legal if the protocol is nothttp
,ftp
,ws
, etc.Because of this issue, a url for git repository cannot be parsed directly, does it make sense to implement the method same as Google Chrome?
The text was updated successfully, but these errors were encountered: