summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorNick Kew <niq@apache.org>2004-09-01 14:24:48 +0200
committerNick Kew <niq@apache.org>2004-09-01 14:24:48 +0200
commitcf9053ecbd964fb016d39d111ce5c23c1ec47644 (patch)
tree8bb4b3430e035ee7c5123f6de0538d7ee4c7a43f /server
parent Add mod_authnz_ldap for the win32 build (diff)
downloadapache2-cf9053ecbd964fb016d39d111ce5c23c1ec47644.tar.xz
apache2-cf9053ecbd964fb016d39d111ce5c23c1ec47644.zip
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
Diffstat (limited to 'server')
-rw-r--r--server/protocol.c5
1 files changed, 4 insertions, 1 deletions
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);
}