diff --git a/app/src/main/java/org/purplei2p/lightning/utils/UrlUtils.java b/app/src/main/java/org/purplei2p/lightning/utils/UrlUtils.java index fdd85eb..1d6cb53 100644 --- a/app/src/main/java/org/purplei2p/lightning/utils/UrlUtils.java +++ b/app/src/main/java/org/purplei2p/lightning/utils/UrlUtils.java @@ -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()) {