diff --git a/source/net/yacy/cora/document/id/MultiProtocolURL.java b/source/net/yacy/cora/document/id/MultiProtocolURL.java index 039a3683a..f4136350c 100644 --- a/source/net/yacy/cora/document/id/MultiProtocolURL.java +++ b/source/net/yacy/cora/document/id/MultiProtocolURL.java @@ -397,7 +397,7 @@ public class MultiProtocolURL implements Serializable, Comparable 0 && relPath.charAt(0) == '/') { this.path = relPath; } else if (baseURL.path.endsWith("/")) { - if (relPath.length() > 0 && (relPath.charAt(0) == '#' || relPath.charAt(0) == '?')) { - throw new MalformedURLException("relative path malformed: " + relPath); - } + /* According to RFC 3986 example in Appendix B. (https://tools.ietf.org/html/rfc3986) + such an URL is valid : http://www.ics.uci.edu/pub/ietf/uri/#Related + + We also find similar usages in the 2016 URL living standard (https://url.spec.whatwg.org/), + for example : https://url.spec.whatwg.org/#syntax-url-absolute-with-fragment + + java.lang.URL constructor also accepts this form.*/ if (relPath.startsWith("/")) this.path = baseURL.path + relPath.substring(1); else this.path = baseURL.path + relPath; } else { if (relPath.length() > 0 && (relPath.charAt(0) == '#' || relPath.charAt(0) == '?')) {