Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
throw MalformedURLException on unknown protocol on other than the supported http https ftp file smb \\ mailto
reger78d08998dbeb
diff --git a/source/net/yacy/cora/document/id/MultiProtocolURL.java b/source/net/yacy/cora/document/id/MultiProtocolURL.javaindex 1fe482bc2..b44de1e46 100644--- a/source/net/yacy/cora/document/id/MultiProtocolURL.java+++ b/source/net/yacy/cora/document/id/MultiProtocolURL.java@@ -190,6 +190,9 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolUif (this.host.indexOf('&') >= 0) throw new MalformedURLException("invalid '&' in host");this.path = resolveBackpath(this.path); // adds "/" if missingidentPort(url, (isHTTP() ? 80 : (isHTTPS() ? 443 : (isFTP() ? 21 : (isSMB() ? 445 : -1)))));+ if (this.port < 0) { // none of known protocols (above) = unknown+ throw new MalformedURLException("unknown protocol: " + url);+ }identAnchor();identSearchpart();escape();@@ -615,7 +618,7 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolUtry {final String portStr = this.host.substring(r + 1);if (portStr.trim().length() > 0) this.port = Integer.parseInt(portStr);- else this.port = -1;+ else this.port = dflt;this.host = this.host.substring(0, r);} catch (final NumberFormatException e) {throw new MalformedURLException("wrong port in host fragment '" + this.host + "' of input url '" + inputURL + "'");