do not replace malformed or invalid URLs in urlproxy

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7835 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
cominch 14 years ago
parent c0d9474b31
commit 09bb7a390c

@ -73,6 +73,7 @@ import java.io.UnsupportedEncodingException;
import java.lang.ref.SoftReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Date;
@ -1392,7 +1393,7 @@ public final class HTTPDFileHandler {
if(m.group(6) != null) url = m.group(6);
if(m.group(8) != null) url = m.group(8);
if(m.group(10) != null) url = m.group(10);
if (url.startsWith("data:") || url.startsWith("#")) {
if (url.startsWith("data:") || url.startsWith("#") || url.startsWith("mailto:") || url.startsWith("javascript:")) {
m.appendReplacement(result, init + url);
} else if (url.startsWith("http")) {
@ -1411,8 +1412,11 @@ public final class HTTPDFileHandler {
} else {
// relative path of form href="relative/path"
MultiProtocolURI target = new MultiProtocolURI(proxyurl.getHost() + directory + "/" + url);
m.appendReplacement(result, init + "/proxy.html?url=" + target.toString());
try {
MultiProtocolURI target = new MultiProtocolURI(proxyurl.getHost() + directory + "/" + url);
m.appendReplacement(result, init + "/proxy.html?url=" + target.toString());
}
catch (MalformedURLException e) {}
}
}

Loading…
Cancel
Save