Author: nextgens
Date: 2007-04-29 20:25:31 +0000 (Sun, 29 Apr 2007)
New Revision: 13055
Modified:
trunk/freenet/src/freenet/keys/FreenetURI.java
Log:
should be done after URLDecoding it
Modified: trunk/freenet/src/freenet/keys/FreenetURI.java
===================================================================
--- trunk/freenet/src/freenet/keys/FreenetURI.java 2007-04-29 20:19:11 UTC
(rev 13054)
+++ trunk/freenet/src/freenet/keys/FreenetURI.java 2007-04-29 20:25:31 UTC
(rev 13055)
@@ -218,7 +218,7 @@
if (URI == null) {
throw new MalformedURLException("No URI specified");
} else
- URI = URI.trim().replaceAll("^http://.*/+", "");
+ URI = URI.trim();
if(URI.indexOf('@') < 0 || URI.indexOf('/') < 0) {
// Encoded URL?
@@ -228,6 +228,9 @@
throw new MalformedURLException("Invalid URI:
no @ or /, or @ or / is escaped but there are invalid escapes");
}
}
+
+ // Strip http:// prefix
+ URI = URI.replaceAll("^http://.*/+", "");
// check scheme
int colon = URI.indexOf(':');