- "javascript:"-URLs are recognized as well (as intended formerly I assume)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3097 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
karlchenofhell 18 years ago
parent a619ba3f49
commit be941c4475

@ -109,13 +109,9 @@ public class URL {
if (relPath == null) throw new MalformedURLException("relPath is null"); if (relPath == null) throw new MalformedURLException("relPath is null");
int p = relPath.indexOf(':'); int p = relPath.indexOf(':');
String relprotocol = (p < 0) ? null : relPath.substring(0, p).toLowerCase(); String relprotocol = (p < 0) ? null : relPath.substring(0, p).toLowerCase();
if (relprotocol != null) { if (relprotocol != null && "http.https.ftp.mailto".indexOf(relprotocol) >= 0) {
if ("http.https.ftp.mailto".indexOf(relprotocol) >= 0) { parseURLString(relPath);
parseURLString(relPath); } else if (relprotocol == null || relprotocol.equals("javascript")) {
} else {
throw new MalformedURLException("unknown protocol: " + relprotocol);
}
} else {
this.protocol = baseURL.protocol; this.protocol = baseURL.protocol;
this.host = baseURL.host; this.host = baseURL.host;
this.port = baseURL.port; this.port = baseURL.port;
@ -149,6 +145,8 @@ public class URL {
identRef(); identRef();
identQuest(); identQuest();
escape(); escape();
} else {
throw new MalformedURLException("unknown protocol: " + relprotocol);
} }
} }
@ -525,7 +523,9 @@ public class URL {
new String[]{"http://www.anomic.de/home", "news:de.test"}, new String[]{"http://www.anomic.de/home", "news:de.test"},
new String[]{"http://www.anomic.de/home", "ftp://ftp.anomic.de/src"}, new String[]{"http://www.anomic.de/home", "ftp://ftp.anomic.de/src"},
new String[]{null, "ftp://ftp.delegate.org/"}, new String[]{null, "ftp://ftp.delegate.org/"},
new String[]{"http://www.anomic.de/home", "ftp://ftp.delegate.org/"} new String[]{"http://www.anomic.de/home", "ftp://ftp.delegate.org/"},
new String[]{"http://www.anomic.de","mailto:yacy@weltherrschaft.org"},
new String[]{"http://www.anomic.de","javascipt:temp"}
}; };
String environment, url; String environment, url;
de.anomic.net.URL aURL = null; de.anomic.net.URL aURL = null;

Loading…
Cancel
Save