-*- coding: utf-8 -*-
Changes with Apache 2.4.47
+ *) core: Remove headers on 304 Not Modified as specified by RFC7234, as
+ opposed to passing an explicit subset of headers. PR 61820.
+ [Giovanni Bechis]
+
*) mpm_event: don't reset connections after lingering close, restoring prior
to 2.4.28 behaviour. [Yann Ylavic]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) core: Correctly strip unwanted headers on 304 response
- Trunk version of patch:
- http://svn.apache.org/r1881590
- http://svn.apache.org/r1881624
- +1: ylavic, covener, minfrin
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
h.bb = b2;
if (r->status == HTTP_NOT_MODIFIED) {
- apr_table_do((int (*)(void *, const char *, const char *)) form_header_field,
- (void *) &h, r->headers_out,
- "Connection",
- "Keep-Alive",
- "ETag",
- "Content-Location",
- "Expires",
- "Cache-Control",
- "Vary",
- "Warning",
- "WWW-Authenticate",
- "Proxy-Authenticate",
- "Set-Cookie",
- "Set-Cookie2",
- NULL);
- }
- else {
- send_all_header_fields(&h, r);
- }
+ /*
+ * 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);