summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2000-11-14 05:52:33 +0100
committerRyan Bloom <rbb@apache.org>2000-11-14 05:52:33 +0100
commit66b3a62de894f6edb484fd67927d72bfb3f47b30 (patch)
tree58f7ab189511869218a27362835f09bf7043041a /modules
parentAssociate a pool with the pool bucket so that it serves it's intended (diff)
downloadapache2-66b3a62de894f6edb484fd67927d72bfb3f47b30.tar.xz
apache2-66b3a62de894f6edb484fd67927d72bfb3f47b30.zip
If the content-length is zero, then we don't output the Content-Length
header file. The only time that the C-L should be zero is if there is no body. Zero is a valid content-length, but the only time that we ever really send it is on a HEAD request right now, and that is incorrect. The HEAD response should have the actual content's length. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86953 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/http/http_protocol.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c
index d054b638d7..e7a90b2341 100644
--- a/modules/http/http_protocol.c
+++ b/modules/http/http_protocol.c
@@ -2490,6 +2490,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, ap_bu
apr_table_addn(r->headers_out, "Expires", date);
}
+ if (!strcmp(apr_table_get(r->headers_out, "Content-Length"), "0")) {
+ apr_table_unset(r->headers_out, "Content-Length");
+ }
+
apr_table_do((int (*) (void *, const char *, const char *)) compute_header_len,
(void *) &len, r->headers_out, NULL);