-*- coding: utf-8 -*-
Changes with Apache 2.2.0
+ *) Preserve the Content-Length header for a proxied HEAD response.
+ PR 18757. [Greg Ames]
+
*) mod_negotiation: Minor performance tweak by reusing already calculated
strlen.
[Ruediger Pluem, Christophe Jaillet <christophe.jaillet wanadoo.fr>]
Trunk version of patch works
+1: rpluem, jerenkrantz
- * core: Stop stripping C-L from HEAD responses which prevents use
- of Windows Update through mod_proxy amongst other things.
- http://svn.apache.org/viewcvs.cgi?rev=327008&view=rev
- PR: 18757
- +1: jorton, jerenkrantz
- +1: niq - this looks fine, but the comment about filters
- misses the fact that mod_filter's protocol handling
- gives us the 'long term' if we just use it.
-
* mod_ssl/ab: Fix compiler warnings with OpenSSL 0.9.8a.
http://svn.apache.org/viewcvs.cgi?rev=349415&view=rev
+1: jorton, jerenkrantz
* 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.
*/
- if (ctx->data_sent == 0 && eos) {
+ if (ctx->data_sent == 0 && eos &&
+ /* don't whack the C-L if it has already been set for a HEAD
+ * by something like proxy. the brigade only has an EOS bucket
+ * in this case, making r->bytes_sent zero.
+ *
+ * if r->bytes_sent > 0 we have a (temporary) body whose length may
+ * have been changed by a filter. the C-L header might not have been
+ * updated so we do it here. long term it would be cleaner to have
+ * such filters update or remove the C-L header, and just use it
+ * if present.
+ */
+ !(r->header_only && r->bytes_sent == 0 &&
+ apr_table_get(r->headers_out, "Content-Length"))) {
ap_set_content_length(r, r->bytes_sent);
}