1
#! /bin/sh /usr/share/dpatch/dpatch-run
3
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: This should switch off deflate for HEAD requests
6
## DP: Patch by Ruediger Pluem
9
--- a/modules/filters/mod_deflate.c (revision 793927)
10
+++ a/modules/filters/mod_deflate.c (working copy)
16
+ * Optimization: If we are a HEAD request and bytes_sent is not zero
17
+ * it means that we have passed the content-length filter once and
18
+ * have more data to sent. This means that the content-length filter
19
+ * could not determine our content-length for the response to the
20
+ * HEAD request anyway (the associated GET request would deliver the
21
+ * body in chunked encoding) and we can stop compressing.
23
+ if (r->header_only && r->bytes_sent) {
24
+ ap_remove_output_filter(f);
25
+ return ap_pass_brigade(f->next, bb);
28
e = APR_BRIGADE_FIRST(bb);
30
if (APR_BUCKET_IS_EOS(e)) {