From 040624e361f0a52f58aa7025de90b594585749f6 Mon Sep 17 00:00:00 2001 From: theli Date: Wed, 15 Feb 2006 12:51:24 +0000 Subject: [PATCH] *) better support for http head requests of servlets git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1648 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/http/httpdFileHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java index d7fac846f..7ac44a0fe 100644 --- a/source/de/anomic/http/httpdFileHandler.java +++ b/source/de/anomic/http/httpdFileHandler.java @@ -662,7 +662,9 @@ public final class httpdFileHandler extends httpdAbstractHandler implements http } // write the array to the client - httpd.sendRespondHeader(this.connectionProperties, out, httpVersion, 200, null, mimeType, result.length, targetDate, null, tp.getOutgoingHeader(), (zipContent)?"gzip":null, null, nocache); + long contentLength = method.equals(httpHeader.METHOD_HEAD)?-1:result.length; + String contentEncoding = method.equals(httpHeader.METHOD_HEAD)?null:(zipContent)?"gzip":null; + httpd.sendRespondHeader(this.connectionProperties, out, httpVersion, 200, null, mimeType, contentLength, targetDate, null, tp.getOutgoingHeader(), contentEncoding, null, nocache); if (! method.equals(httpHeader.METHOD_HEAD)) { Thread.sleep(200); // this solved the message problem (!!) serverFileUtils.write(result, out);