On Oct 18, 2005, at 3:58 PM, Greg Ames wrote:

Index: server/protocol.c
===================================================================
--- server/protocol.c   (revision 326257)
+++ server/protocol.c   (working copy)
@@ -1302,7 +1302,13 @@
* We can only set a C-L in the response header if we haven't already
      * sent any buckets on to the next output filter for this request.
      */
-    if (ctx->data_sent == 0 && eos) {
+    if (ctx->data_sent == 0 && eos &&
+         /* don't whack the C-L if it has already been set for a HEAD
+ * by something like proxy. the brigade only has an EOS bucket
+          * in this case, making r->bytes_sent zero.
+          */
+        !(r->header_only && r->bytes_sent == 0 &&
+            apr_table_get(r->headers_out, "Content-Length"))) {
         ap_set_content_length(r, r->bytes_sent);
     }

Why "&& r->bytes_sent == 0" ?  If it is a HEAD request and C-L
has already been set, then r->bytes_sent should be irrelevant,
especially given ctx->data_sent == 0.

....Roy

Reply via email to