From: Guenter Knauf Date: Wed, 6 Oct 2010 10:35:12 +0000 (+0000) Subject: Fixed mod_expires: Expires time shouldn't be in the past. X-Git-Tag: 2.0.64~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abd8be006b8bf00e1bd34ba5aff6f89cb1ed2ec2;p=thirdparty%2Fapache%2Fhttpd.git Fixed mod_expires: Expires time shouldn't be in the past. r1002205 in test framework needs to be reverted now since this is fixed. Author: rjung, reviewed by: wrowe, sf. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@1004974 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 854d7557bcc..fdc1ec9710f 100644 --- a/STATUS +++ b/STATUS @@ -132,13 +132,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_expires: Expires time shouldn't be in the past - Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=708902 - 2.2.x patch: http://svn.apache.org/viewvc?view=revision&revision=713142 - Backport: http://people.apache.org/~rjung/patches/expires-in-the-past-2_0.patch - Revert r1002205 in test framework, once this is fixed. - +1: rjung, wrowe, sf - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ please place SVN revisions from trunk here, so it is easy to identify exactly what the proposed changes are! Add all new diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index 7dfeb964b11..7c2b78a5a1b 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -427,6 +427,9 @@ static int set_expiration_fields(request_rec *r, const char *code, } expires = base + additional; + if (expires < r->request_time) { + expires = r->request_time; + } apr_table_mergen(t, "Cache-Control", apr_psprintf(r->pool, "max-age=%" APR_TIME_T_FMT, apr_time_sec(expires - r->request_time)));