From cf9053ecbd964fb016d39d111ce5c23c1ec47644 Mon Sep 17 00:00:00 2001 From: Nick Kew Date: Wed, 1 Sep 2004 12:24:48 +0000 Subject: Fix for Bug 18757 (sending bogus content-length of zero in no-body requests) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104923 13f79535-47bb-0310-9956-ffa450edef68 --- server/protocol.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/protocol.c b/server/protocol.c index c051822c6c..cf62767e7f 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -1244,8 +1244,11 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_content_length_filter( * * 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. + * + * Also check against cases of zero bytes sent, to avoid a bogus + * C-L on HEAD requests, or no-body GETs like 204s. */ - if (ctx->data_sent == 0 && eos) { + if (ctx->data_sent == 0 && eos && r->bytes_sent > 0 ) { ap_set_content_length(r, r->bytes_sent); } -- cgit v1.2.3