From: Ruediger Pluem Date: Fri, 30 Apr 2021 20:08:46 +0000 (+0000) Subject: * Do not strip any headers from 304 responses. X-Git-Tag: 2.5.0-alpha2-ci-test-only~953 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=886cb0d6aa22753536d42134d3e40033b7d4e21b;p=thirdparty%2Fapache%2Fhttpd.git * Do not strip any headers from 304 responses. PR: 61820 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1889341 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/fix_pr61820_regression.txt b/changes-entries/fix_pr61820_regression.txt new file mode 100644 index 00000000000..c1ce8e5c8f2 --- /dev/null +++ b/changes-entries/fix_pr61820_regression.txt @@ -0,0 +1,2 @@ + *) core: Fix a regression that stripped the ETag header from 304 responses. + PR 61820 [Ruediger Pluem, Roy T. Fielding] diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c index 482a3f97de0..289ba49abed 100644 --- a/modules/http/http_filters.c +++ b/modules/http/http_filters.c @@ -1433,21 +1433,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, h.pool = r->pool; h.bb = b2; - if (r->status == HTTP_NOT_MODIFIED) { - /* - * List of headers that must not be updated on a 304 (or 206 partial content) - * https://tools.ietf.org/id/draft-ietf-httpbis-cache-08.txt - */ - apr_table_unset(r->headers_out, "Content-Encoding"); - apr_table_unset(r->headers_out, "Content-Length"); - apr_table_unset(r->headers_out, "Content-MD5"); - apr_table_unset(r->headers_out, "Content-Range"); - apr_table_unset(r->headers_out, "ETag"); - apr_table_unset(r->headers_out, "TE"); - apr_table_unset(r->headers_out, "Trailer"); - apr_table_unset(r->headers_out, "Transfer-Encoding"); - apr_table_unset(r->headers_out, "Upgrade"); - } send_all_header_fields(&h, r); terminate_header(b2);