diff -rNu httpd-2.0.49.orig/modules/experimental/cache_util.c httpd-2.0.49/modules/experimental/cache_util.c --- httpd-2.0.49.orig/modules/experimental/cache_util.c 2004-02-09 21:53:16.000000000 +0100 +++ httpd-2.0.49/modules/experimental/cache_util.c 2004-03-20 15:55:51.000000000 +0100 @@ -516,3 +516,25 @@ apr_table_unset(headers_out, "Upgrade"); return headers_out; } + +/* Create a new table consisting of those elements from a request_rec's + * headers_in that are allowed to be stored in a cache. + */ +CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_in(request_rec *r) +{ + /* Make a copy of the request headers, and remove from + * the copy any hop-by-hop headers, as defined in Section + * 13.5.1 of RFC 2616 + */ + apr_table_t *headers_in; + headers_in = apr_table_copy(r->pool, r->headers_in); + apr_table_unset(headers_in, "Connection"); + apr_table_unset(headers_in, "Keep-Alive"); + apr_table_unset(headers_in, "Proxy-Authenticate"); + apr_table_unset(headers_in, "Proxy-Authorization"); + apr_table_unset(headers_in, "TE"); + apr_table_unset(headers_in, "Trailers"); + apr_table_unset(headers_in, "Transfer-Encoding"); + apr_table_unset(headers_in, "Upgrade"); + return headers_in; +} diff -rNu httpd-2.0.49.orig/modules/experimental/mod_cache.h httpd-2.0.49/modules/experimental/mod_cache.h --- httpd-2.0.49.orig/modules/experimental/mod_cache.h 2004-02-09 21:53:16.000000000 +0100 +++ httpd-2.0.49/modules/experimental/mod_cache.h 2004-03-20 15:55:51.000000000 +0100 @@ -238,6 +238,11 @@ */ CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_out(apr_pool_t *pool, apr_table_t *t); +/* Create a new table consisting of those elements from a request_rec's + * headers_in that are allowed to be stored in a cache + */ +CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_in(request_rec *r); + /** * cache_storage.c */ diff -rNu httpd-2.0.49.orig/modules/experimental/mod_disk_cache.c httpd-2.0.49/modules/experimental/mod_disk_cache.c --- httpd-2.0.49.orig/modules/experimental/mod_disk_cache.c 2004-02-09 21:53:16.000000000 +0100 +++ httpd-2.0.49/modules/experimental/mod_disk_cache.c 2004-03-20 15:55:51.000000000 +0100 @@ -600,8 +600,9 @@ /* @@@ Some day, not today. */ if (r->headers_in) { int i; - apr_table_entry_t *elts = (apr_table_entry_t *) apr_table_elts(r->headers_in)->elts; - for (i = 0; i < apr_table_elts(r->headers_in)->nelts; ++i) { + apr_table_t* headers_in = ap_cache_cacheable_hdrs_in(r); + apr_table_entry_t *elts = (apr_table_entry_t *) apr_table_elts(headers_in)->elts; + for (i = 0; i < apr_table_elts(headers_in)->nelts; ++i) { if (elts[i].key != NULL) { buf = apr_pstrcat(r->pool, elts[i].key, ": ", elts[i].val, CRLF, NULL); amt = strlen(buf);