*) further improvements for the anomic.net.url class

- relpath starting with javascript: are ignored now
   - bugfix for concatenation of relpath starting with # or ?
     in this case no slash should be added to the baseURL, otherwise
     we get URLs of the form http://test.de/index.html/?param=value

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2298 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent 8a1f1d96b3
commit a70cbd959b

@ -86,8 +86,14 @@ public class URL {
this.protocol = baseURL.protocol;
this.host = baseURL.host;
this.port = baseURL.port;
if (relPath.startsWith("/")) this.path = relPath;
else this.path = (baseURL.path.endsWith("/")) ? (baseURL.path + relPath) : (baseURL.path + "/" + relPath);
if (relPath.toLowerCase().startsWith("javascript:")) this.path = baseURL.path;
else if (relPath.startsWith("/")) this.path = relPath;
else {
if (relPath.startsWith("#") ||
relPath.startsWith("?") ||
baseURL.path.endsWith("/")) this.path = baseURL.path + relPath;
else this.path = baseURL.path + "/" + relPath;
}
this.quest = baseURL.quest;
this.ref = baseURL.ref;

Loading…
Cancel
Save