From 17cbdd03f3936bbf12d8b53bacb1b0f19ce5ff1d Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Sun, 10 Nov 2002 06:09:20 +0000 Subject: [PATCH] Always emit Vary header if mod_deflate is involved in the request. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Submitted by: Andr��Malo Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97473 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/filters/mod_deflate.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 60f6573a36..9ed4263364 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.44 + *) Always emit Vary header if mod_deflate is involved in the + request. [AndréMalo ] + *) mod_isapi: Stop unsetting the 'empty' query string result with a NULL argument in ecb->lpszQueryString, eliminating segfaults for some ISAPI modules. PR 14399 diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 0425a78df0..bbb66d2cce 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -306,6 +306,12 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, } } + /* Even if we don't accept this request based on it not having + * the Accept-Encoding, we need to note that we were looking + * for this header and downstream proxies should be aware of that. + */ + apr_table_setn(r->headers_out, "Vary", "Accept-Encoding"); + /* if they don't have the line, then they can't play */ accepts = apr_table_get(r->headers_in, "Accept-Encoding"); if (accepts == NULL) { @@ -369,7 +375,6 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, else { apr_table_mergen(r->headers_out, "Content-Encoding", "gzip"); } - apr_table_setn(r->headers_out, "Vary", "Accept-Encoding"); apr_table_unset(r->headers_out, "Content-Length"); /* initialize deflate output buffer */ -- 2.40.0