-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add removePort
option
#171
Comments
Why would it remove |
Hi, Thanks for your quick reply. hmm, well in my case I wanted an option to remove the port so I can create a more user friendly/readable url. I used your library but had to do an additional step of regex to strip the I had assumed your library would have let me remove the port (any port) on the url, instead of it deciding when a port should be removed or kept. Do you think that adding an option to remove a port (any port found) to your library would be a feature you could implement?
it could be named something like "removePort" |
Removing port 80 from a HTTPS URL would could potentially break the URL, although unlikely. I'm ok with a |
removePort
option
Nice, I can work on this task. Just to get some clarity before I make a pull request, when you said:
When I add the |
I think Because https://example.com:80 and https://example.com is NOT SAME AT ALL, they MAY just happen to LOOK same in specific cases.
This suggestion may prevent confusion with the |
ok sounds good. I will work on making a pull request for this |
Pull request has been created: #174 |
In the Docs, you have an example that has a port on a url and then when you wrap the url with "normalizeUrl" the port is no longer included:
When I run this same example locally, the Port
:80/
is still included - which is different behavior from what your documentation example above shows:How would I remove the
:80/
port portion of a url with your package ?I am pretty sure there is a bug because when I did another test the behavior is not consistent. As you can see in the image below, the results are not consistent just by changing a url from having
http
toohttps
and also I see that just changing the actual number for the port in the url makes the behavior different too:The text was updated successfully, but these errors were encountered: