Skip to content

Commit

Permalink
Do not attempt to create link previews for .i2p links
Browse files Browse the repository at this point in the history
  • Loading branch information
n0toose authored and alan-signal committed Aug 27, 2020
1 parent 368284c commit 3a9a84a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static Collection<Object[]> data() {
{ "http://asĸ.com", false },
{ "http://foo.кц.рф", false },
{ "https://abcdefg.onion", false },
{ "https://abcdefg.i2p", false },
{ "", false }
});
}
Expand Down

0 comments on commit 3a9a84a

Please sign in to comment.