Skip to content

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

- don't send Message Body on HEAD requests, even in the case of an error

hermensc8f5adea4d37
diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java
index ec4eeb2ed..34c3989e1 100644
--- a/source/de/anomic/http/httpd.java
+++ b/source/de/anomic/http/httpd.java
@@ -1141,9 +1141,11 @@ public final class httpd implements serverHandler {
header.put(httpHeader.CONTENT_LENGTH, Integer.toString(result.length));
header.put(httpHeader.PRAGMA, "no-cache");
sendRespondHeader(conProp,respond,httpVersion,httpStatusCode,httpStatusText,header);
-
- // write the array to the client
- serverFileUtils.write(result, respond);
+
+ if (! method.equals(httpHeader.METHOD_HEAD)) {
+ // write the array to the client
+ serverFileUtils.write(result, respond);
+ }
respond.flush();
} catch (Exception e) {
throw new IOException(e.getMessage());