Closed dawidmohr closed 6 months ago
I wanted to use normalize-url in my project, but I noticed a problem
In the documentation, one of the examples does not work (the one I need :))
normalizeUrl('sindresorhus.com:123', { removeExplicitPort: true }); //=> 'http://sindresorhus.com'
t.is(normalizeUrl('sindresorhus.com:123', options), 'http://sindresorhus.com');
The test returned: 'sindresorhus.com:123' so there is an issue
'sindresorhus.com:123'
I looked at the code and noticed that the hasCustomProtocol function returns the wrong value
hasCustomProtocol
So I prepared a quick fix, but I'm not a URL specialist, my PR is rather illustrative, so feel free to close it https://github.com/sindresorhus/normalize-url/pull/186
My thought was that there are no dots in the protocol, and there is always a dot between the domain name and the TLD, so did this
I wanted to use normalize-url in my project, but I noticed a problem
In the documentation, one of the examples does not work (the one I need :))
The test returned:
'sindresorhus.com:123'
so there is an issueI looked at the code and noticed that the
hasCustomProtocol
function returns the wrong valueSo I prepared a quick fix, but I'm not a URL specialist, my PR is rather illustrative, so feel free to close it https://github.com/sindresorhus/normalize-url/pull/186
My thought was that there are no dots in the protocol, and there is always a dot between the domain name and the TLD, so did this