Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) Bugfix for URLs containing spaces See: http://www.yacy-forum.de/viewtopic.php?t=1640

theli75aad0fe6646
diff --git a/source/de/anomic/http/httpHeader.java b/source/de/anomic/http/httpHeader.java
index f5166a4ce..1e92a09fb 100644
--- a/source/de/anomic/http/httpHeader.java
+++ b/source/de/anomic/http/httpHeader.java
@@ -501,8 +501,8 @@ public final class httpHeader extends TreeMap implements Map {
}
// store the version propery "HTTP" and cut the query at both ends
- int sep = args.indexOf(" ");
- if (sep >= 0) {
+ int sep = args.lastIndexOf(" ");
+ if ((sep >= 0)&&(args.substring(sep + 1).toLowerCase().startsWith("http/"))) {
// HTTP version is given
prop.setProperty(httpHeader.CONNECTION_PROP_HTTP_VER, args.substring(sep + 1).trim());
args = args.substring(0, sep).trim(); // cut off HTTP version mark
@@ -511,6 +511,10 @@ public final class httpHeader extends TreeMap implements Map {
prop.setProperty(httpHeader.CONNECTION_PROP_HTTP_VER, "HTTP/0.9");
}
+ // replacing spaces in the url string correctly
+ args = args.replaceAll(" ","%20");
+
+
// properties of the query are stored with the prefix "&"
// additionally, the values URL and ARGC are computed