Received: by taz.hyperreal.com (8.7.5/V2.0) id MAA10251; Thu, 19 Sep 1996 12:35:56 -0700 (PDT) Received: from creche.cygnus.com by taz.hyperreal.com (8.7.5/V2.0) with SMTP id MAA10185; Thu, 19 Sep 1996 12:35:43 -0700 (PDT) Received: (from tromey@localhost) by creche.cygnus.com (8.6.12/8.6.9) id NAA22502; Thu, 19 Sep 1996 13:37:20 -0600 To: Apache List Subject: http/1.0: more If-Modified-Since X-Zippy: Now, let's SEND OUT for QUICHE!! X-Attribution: Tom From: Tom Tromey Date: 19 Sep 1996 13:37:19 -0600 Message-ID: Lines: 67 X-Mailer: Red Gnus v0.34/Emacs 19.34 Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com The section of the HTTP spec dealing with If-Modified-Since says this: a) If the request would normally result in anything other than a 200 (ok) status, or if the passed If-Modified-Since date is invalid, the response is exactly the same as for a normal GET. A date which is later than the server's current time is invalid. This assertion is currently not checked in Apache 1.1.1. You can verify this by doing a GET request with an If-Modified-Since date in the year 2000. Appended is a patch that fixes this bug. It has to be applied over my previous If-Modified-Since patch. Tom -- tromey@cygnus.com Member, League for Programming Freedom ? mod_xinclude.c Index: http_protocol.c =================================================================== RCS file: /rel/cvsfiles/devo/apache/src/http_protocol.c,v retrieving revision 1.2 diff -c -5 -r1.2 http_protocol.c *** http_protocol.c 1996/09/19 18:58:49 1.2 --- http_protocol.c 1996/09/19 19:24:44 *************** *** 182,191 **** --- 182,192 ---- int set_last_modified(request_rec *r, time_t mtime) { char *ts; char *if_modified_since = table_get (r->headers_in, "If-modified-since"); + time_t server_time = time (NULL); /* Cacheing proxies use the absence of a Last-modified header * to indicate that a document is dynamic and shouldn't be cached. * For the moment, we enforce that here, though it would probably * work just as well to generate an Expires: header in send_http_header. *************** *** 203,213 **** /* Check for conditional GETs --- note that we only want this check * to succeed if the GET was successful; ErrorDocuments *always* get sent. */ if (r->status == 200 && !r->header_only && ! if_modified_since && later_than(gmtime(&mtime), if_modified_since)) return USE_LOCAL_COPY; else return OK; } --- 204,215 ---- /* Check for conditional GETs --- note that we only want this check * to succeed if the GET was successful; ErrorDocuments *always* get sent. */ if (r->status == 200 && !r->header_only && ! if_modified_since && later_than(gmtime(&mtime), if_modified_since) ! && !later_than(gmtime(&server_time), if_modified_since)) return USE_LOCAL_COPY; else return OK; }