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

Use regex to check that the port is a series of digits 0-9. #32

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

ronyeh
Copy link
Contributor

@ronyeh ronyeh commented Jan 26, 2022

Fixes #31

From the URL spec at https://url.spec.whatwg.org/#url-port-string

A URL-port string must be one of the following:

  • the empty string
  • one or more ASCII digits representing a decimal number no greater than 2^16 − 1.

This example from Microsoft uses the \d+ regex, so that seems like a fine way to match port numbers:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-extract-a-protocol-and-port-number-from-a-url

@ronyeh
Copy link
Contributor Author

ronyeh commented Feb 27, 2022

Thanks for merging! Would it be possible to make a new NPM patch release so that our project can make use of the fix? Thanks again!

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 this pull request may close these issues.

Does not parse pathname when git username is a hexadecimal number.
2 participants