Tell HN: Android Patterns.WEB_URL does not match IPv6

3 points by SushiHippie ↗ HN
I found a bug in an open source app I'm using, regarding http URLs with an ipv6 address, and before opening an issue I checked why this happened.

To my surprise the code was very simple and relied on the android.util.Patterns.WEB_URL pattern, which according to the docs should match all RFC 3987 IRIs.

But I took a look at the Patterns.java source code, and saw that it does not match ipv6 addresses.

https://developer.android.com/reference/android/util/Patterns#WEB_URL

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/core/java/android/util/Patterns.java#376

2 comments

[ 3.6 ms ] story [ 14.0 ms ] thread