fix: IPv6 INTRANET_PATTERNS for local ip (see http://bugs.yacy.net/view.php?id=378)

requiring following ":" for fc and fd prefix and made pattern match case insesitive
- add some more ipv6 test cases to MultiProtocolURLTest.java
pull/1/head
reger 11 years ago
parent 61e51d47a5
commit 6878c90f99

@ -75,8 +75,8 @@ public class Domains {
private static final Set<String> ccSLD_TLD = new HashSet<String>();
private static final String PRESENT = "";
private static final Pattern LOCALHOST_PATTERNS = Pattern.compile("(127\\..*)|(localhost)|(\\[?(fe80|0)\\:0\\:0\\:0\\:0\\:0\\:0\\:1.*)");
private static final Pattern INTRANET_PATTERNS = Pattern.compile("(10\\..*)|(127\\..*)|(172\\.(1[6-9]|2[0-9]|3[0-1])\\..*)|(169\\.254\\..*)|(192\\.168\\..*)|(localhost)|(\\[?\\:\\:1/.*)|(\\[?fc.*)|(\\[?fd.*)|(\\[?(fe80|0)\\:0\\:0\\:0\\:0\\:0\\:0\\:1.*)");
private static final Pattern INTRANET_PATTERNS = Pattern.compile("(10\\..*)|(127\\..*)|(172\\.(1[6-9]|2[0-9]|3[0-1])\\..*)|(169\\.254\\..*)|(192\\.168\\..*)|(localhost)|(\\[?\\:\\:1/.*)|(\\[?fc.*\\:.*)|(\\[?fd.*\\:.*)|(\\[?(fe80|0)\\:0\\:0\\:0\\:0\\:0\\:0\\:1.*)", Pattern.CASE_INSENSITIVE);
private static final int MAX_NAME_CACHE_HIT_SIZE = 10000;
private static final int MAX_NAME_CACHE_MISS_SIZE = 1000;
private static final int CONCURRENCY_LEVEL = Runtime.getRuntime().availableProcessors() * 2;

@ -81,6 +81,13 @@ public class MultiProtocolURLTest {
testurls.put("http://[::1]/index.html", Boolean.TRUE);
testurls.put("http://[::1]:8090/index.html", Boolean.TRUE);
testurls.put("http://[0::1]/index.html", Boolean.TRUE);
testurls.put("http://[::0:1]:80/index.html", Boolean.TRUE);
testurls.put("http://[fc00:0:0:0:0:0:0:1]/index.html", Boolean.TRUE);
testurls.put("http://[fc00::fa01:ff]/index.html", Boolean.TRUE);
testurls.put("http://[fD00:0:0:0:0:0:0:1]/index.html", Boolean.TRUE);
testurls.put("http://[fe80:0:0:0:0:0:0:1]/index.html", Boolean.TRUE);
testurls.put("http://[fe80::1]/index.html", Boolean.TRUE);
// test urls for possible issue with IPv6 misinterpretation
testurls.put("http://fcedit.com", Boolean.FALSE);

Loading…
Cancel
Save