You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/01/02 22:33:37 UTC

MSIE and laguages and a bug? in mod_expires

If after receiving a 406 response you reload the page with MSIE or
follow a link to the same page, then you end up with something different.

It would appear the MSIE sends a different request (no Accept-Language)
is my guess. It's also possible that MSIE is caching the 406 error.

Anyone care to look into this ?. I don't have MSIE here.

Also, mod_expires.c is adding an "Expires" header regardless of the status,
this could be confusing MSIE here.

How about this as a fix for mod_expires (which includes an earlier
patch that has yet to be accepted) ?   (note that "conf" is now initialised
later, but only if it is going to be used).


Index: mod_expires.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_expires.c,v
retrieving revision 1.2
diff -u -r1.2 mod_expires.c
--- mod_expires.c       1997/01/02 03:35:02     1.2
+++ mod_expires.c       1997/01/02 21:24:29
@@ -383,18 +383,24 @@
 
 int add_expires(request_rec *r)
 {
-    expires_dir_config *conf =
-            (expires_dir_config *)get_module_config(r->per_dir_config, &expires_module);
+    expires_dir_config *conf;
     char *code;
     time_t base; 
     time_t additional; 
     time_t expires; 
 
+    if (r->status >= 400) {  /* Don't add Expires headers to errors */
+       return DECLINED;
+    }
+
+    if (r->main != NULL) {   /* Don't find Expires headers for subrequests */
+       return DECLINED;
+    }
+
     if ( r->finfo.st_mode == 0 )
        return DECLINED;
 
-    /* COMMA bites my ass...
-     */
+    conf = (expires_dir_config *)get_module_config(r->per_dir_config, &expires_module);
     if ( conf == NULL ) {
         log_reason ("internal error in expires_module; add_expires(), conf == NULL", r->filename, r);
        return SERVER_ERROR;


Re: MSIE and laguages and a bug? in mod_expires

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Thu, 2 Jan 1997, Rob Hartill wrote:

> How about this as a fix for mod_expires (which includes an earlier
> patch that has yet to be accepted) ?   (note that "conf" is now initialised
> later, but only if it is going to be used).

IMHO, you should use the is_HTTP_ERROR() macro instead of checking the
response status yourself.

-- 
________________________________________________________________________
Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/