From: Justin Erenkrantz Date: Wed, 19 Sep 2001 06:20:32 +0000 (+0000) Subject: Fix case where an included file may change but the shtml file has not - X-Git-Tag: 2.0.26~221 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ddc7f2f952ba1196f5a44fde7a0253554957f4ed;p=apache Fix case where an included file may change but the shtml file has not - since we returned Last-Modified/ETag headers, we said that it was possibly cacheable. Wrong. See RFC 2616 13.3.4 for more details (these are SHOULD/MAY clauses, so I think we can discard them when we are dealing with dynamic data). (Justin cleaned up the comment to cite RFC 2616.) Submitted by: Ian Holsman Reviewed by: Justin Erenkrantz, Aaron Bannert, Brian Pane git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91080 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 621f0f9f47..4089a46f79 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.26-dev + *) Fix mod_include to not return ETag or Last-Modified headers. + [Ian Holsman ] + *) Fix worker MPM's scoreboard logic. [Aaron Bannert ] *) Eliminate the wasteful run-time conversion of method names from strings diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index e949ff2f7c..72532fa152 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -3082,6 +3082,14 @@ static apr_status_t includes_filter(ap_filter_t *f, apr_bucket_brigade *b) */ apr_table_unset(f->r->headers_out, "Content-Length"); + /* Always unset the ETag/Last-Modified fields - see RFC2616 - 13.3.4. + * We don't know if we are going to be include a virtual file (think + * exec) which may make the content completely dynamic or change the + * Last-Modified header. Therefore, we can't support these headers. + */ + apr_table_unset(f->r->headers_out, "ETag"); + apr_table_unset(f->r->headers_out, "Last-Modified"); + rv = send_parsed_content(&b, r, f); if (parent) {