Skip to content

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

fix for wrong http connection version and SSIs

orbiter154ffd7c2c69
diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java
index c32b3b8a0..57d0fb213 100644
--- a/source/de/anomic/http/httpd.java
+++ b/source/de/anomic/http/httpd.java
@@ -1358,7 +1358,7 @@ public final class httpd implements serverHandler {
String reqMethod = conProp.getProperty(httpHeader.CONNECTION_PROP_METHOD);
if ((transferEnc != null) && !httpVersion.equals(httpHeader.HTTP_VERSION_1_1)) {
- throw new IllegalArgumentException("Transfer encoding is only supported for http/1.1 connections.");
+ throw new IllegalArgumentException("Transfer encoding is only supported for http/1.1 connections. The current connection version is " + httpVersion);
}
if (!reqMethod.equals(httpHeader.METHOD_HEAD)){
diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java
index 92f6ffeab..f77f23641 100644
--- a/source/de/anomic/http/httpdFileHandler.java
+++ b/source/de/anomic/http/httpdFileHandler.java
@@ -706,7 +706,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http
// we can do that either in standard mode (whole thing completely) or in chunked mode
// since yacy clients do not understand chunked mode, we use this only for communication with the administrator
boolean yacyClient = requestHeader.userAgent().startsWith("yacy");
- boolean chunked = !method.equals(httpHeader.METHOD_HEAD) && !yacyClient;
+ boolean chunked = !method.equals(httpHeader.METHOD_HEAD) && !yacyClient && httpVersion.equals(httpHeader.HTTP_VERSION_1_1);
if (chunked) {
// send page in chunks and parse SSIs
serverByteBuffer o = new serverByteBuffer();