summaryrefslogtreecommitdiffstats
path: root/modules/http
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2015-05-07 16:05:25 +0200
committerYann Ylavic <ylavic@apache.org>2015-05-07 16:05:25 +0200
commit725bf57c4b1e1a80ba140182ee042f4a08156afc (patch)
tree7ac1eba74255f4947369b0df1335e1c74b2a6ffa /modules/http
parentmod_ssl namespacing: Rename SSL_SESSION_id2sz() to modssl_SSL_SESSION_id2sz(). (diff)
downloadapache2-725bf57c4b1e1a80ba140182ee042f4a08156afc.tar.xz
apache2-725bf57c4b1e1a80ba140182ee042f4a08156afc.zip
http: Don't remove the Content-Length of zero from a HEAD response if
it comes from an origin server, module or script. Instead of removing the C-L in ap_http_header_filter() after it has been set by ap_content_length_filter(), just don't set it in the latter. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1678215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http')
-rw-r--r--modules/http/http_filters.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c
index 4bc7c82113..7ebb619f55 100644
--- a/modules/http/http_filters.c
+++ b/modules/http/http_filters.c
@@ -1127,7 +1127,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
{
request_rec *r = f->r;
conn_rec *c = r->connection;
- const char *clheader;
const char *protocol = NULL;
apr_bucket *e;
apr_bucket_brigade *b2;
@@ -1274,30 +1273,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
apr_table_addn(r->headers_out, "Expires", date);
}
- /* This is a hack, but I can't find anyway around it. The idea is that
- * we don't want to send out 0 Content-Lengths if it is a head request.
- * This happens when modules try to outsmart the server, and return
- * if they see a HEAD request. Apache 1.3 handlers were supposed to
- * just return in that situation, and the core handled the HEAD. In
- * 2.0, if a handler returns, then the core sends an EOS bucket down
- * the filter stack, and the content-length filter computes a C-L of
- * zero and that gets put in the headers, and we end up sending a
- * zero C-L to the client. We can't just remove the C-L filter,
- * because well behaved 2.0 handlers will send their data down the stack,
- * and we will compute a real C-L for the head request. RBB
- *
- * Allow modification of this behavior through the
- * HttpContentLengthHeadZero directive.
- *
- * The default (unset) behavior is to squelch the C-L in this case.
- */
- if (r->header_only
- && (clheader = apr_table_get(r->headers_out, "Content-Length"))
- && !strcmp(clheader, "0")
- && conf->http_cl_head_zero != AP_HTTP_CL_HEAD_ZERO_ENABLE) {
- apr_table_unset(r->headers_out, "Content-Length");
- }
-
b2 = apr_brigade_create(r->pool, c->bucket_alloc);
basic_http_header(r, b2, protocol);