summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
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);
}