handle i2p domains without scheme (like main tlds)
This commit is contained in:
parent
9424a26e65
commit
6ae7bd9e48
@ -38,6 +38,7 @@ public class UrlUtils {
|
||||
'(' + // begin group for schema
|
||||
"(?:http|https|file)://" +
|
||||
"|(?:inline|data|about|javascript):" +
|
||||
"|(?:.+\\.i2p)" +
|
||||
"|(?:.*:.*@)" +
|
||||
')' +
|
||||
"(.*)");
|
||||
@ -66,7 +67,9 @@ public class UrlUtils {
|
||||
// force scheme to lowercase
|
||||
String scheme = matcher.group(1);
|
||||
String lcScheme = scheme.toLowerCase();
|
||||
if (!lcScheme.equals(scheme)) {
|
||||
if (lcScheme.contains(".i2p")) {
|
||||
inUrl = "http://" + lcScheme + matcher.group(2);
|
||||
} else if (!lcScheme.equals(scheme)) {
|
||||
inUrl = lcScheme + matcher.group(2);
|
||||
}
|
||||
if (hasSpace && Patterns.WEB_URL.matcher(inUrl).matches()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user