Do not attempt to create link previews for .i2p links

master
Panagiotis Vasilopoulos 2020-08-26 17:53:14 +03:00 committed by Alan Evans
parent 368284cccc
commit 3a9a84a0b1
2 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,7 @@ public final class LinkPreviewUtil {
private static final Pattern FAVICON_PATTERN = Pattern.compile("<\\s*link[^>]*rel\\s*=\\s*\".*icon.*\"[^>]*>");
private static final Pattern FAVICON_HREF_PATTERN = Pattern.compile("href\\s*=\\s*\"([^\"]*)\"");
private static final Set<String> INVALID_TOP_LEVEL_DOMAINS = Sets.newHashSet("onion");
private static final Set<String> INVALID_TOP_LEVEL_DOMAINS = Sets.newHashSet("onion", "i2p");
/**
* @return All whitelisted URLs in the source text.

View File

@ -29,6 +29,7 @@ public class LinkPreviewUtilTest_isLegal {
{ "http://asĸ.com", false },
{ "http://foo.кц.рф", false },
{ "https://abcdefg.onion", false },
{ "https://abcdefg.i2p", false },
{ "", false }
});
}