You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for that package and your work.
The commit that adds support for invalid IPV6 URLs (b32d16c) seems to introduce a parsing error for URLs with special query parameters like an ISO date and time (the colon is misinterpreted as an IPV6 address separator).
Here is an example of such an URL: http://www.sample.com/search?updated-max=2020-04-16T09:14:00+10:00
With current invalidIpv6Pattern the whole url is surrounded by []: http://[www.sample.com/search?updated-max=2020-04-16T09:14:00+10:00].
I think this behavior can be fixed by using the following updated pattern. const invalidIpv6Pattern = /^([a-z][*+.a-z-]+:\/\/)([^[][^/?]*:[^/?]*:[^/?]*)(.*)/i;
This ensures that only the part before the first / or ? is taken into account to detect a potential IPV6 address (I replaced the .* pattern with [^/?]*).
Let me know if these comments are not clear enough.
The text was updated successfully, but these errors were encountered:
Hello.
First of all, thank you for that package and your work.
The commit that adds support for invalid IPV6 URLs (b32d16c) seems to introduce a parsing error for URLs with special query parameters like an ISO date and time (the colon is misinterpreted as an IPV6 address separator).
Here is an example of such an URL:
http://www.sample.com/search?updated-max=2020-04-16T09:14:00+10:00
With current
invalidIpv6Pattern
the whole url is surrounded by[]
:http://[www.sample.com/search?updated-max=2020-04-16T09:14:00+10:00]
.I think this behavior can be fixed by using the following updated pattern.
const invalidIpv6Pattern = /^([a-z][*+.a-z-]+:\/\/)([^[][^/?]*:[^/?]*:[^/?]*)(.*)/i;
This ensures that only the part before the first
/
or?
is taken into account to detect a potential IPV6 address (I replaced the.*
pattern with[^/?]*
).Let me know if these comments are not clear enough.
The text was updated successfully, but these errors were encountered: