httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Phillips <pa...@go2net.com>
Subject mod_expires patch
Date Thu, 27 Aug 1998 02:14:52 GMT
While trying to get mod_expires to attach an expires header to
some jserv generated output, it was discovered that mod_expires
attempts to stat the file in all cases and refuses to generate
an expires header unless it exists.  I happened to have easy
access to Marc and asked why, but he knew of no reason why this
is so.  I suppose most dynamic content that wants expires
headers generates its own, but is there reason to preclude them
from using mod_expires?

It feels like a misfeature/bug to me.  Here's a patch (against
1.2.6, but it isn't exactly complicated to apply to 1.3.1) that
only declines the request when the file doesn't exist in the
case where it's supposed to do something based on the file's
last modified time.

I wouldn't mind seeing this in 1.3.2, but that would imply a 
behavior change (dynamic content under some configurations might
suddenly start getting expires headers where none came before.)
That's what release notes are for of course.

Any comments?

-- 
Paul Phillips      | Some people ask me, "Hey, Alex! You are crazy! Why should
Shop Herder        | we build teleportation? Its so impossible!"
<paulp@go2net.com> |     -- Alex Chiu <www.alexchiu.com>
+1 206 447 1595    |--------* http://www.go2net.com/people/paulp/ *--------


*** ./mod_expires.c.orig	Wed Aug 26 19:01:17 1998
--- mod_expires.c	Wed Aug 26 19:00:57 1998
***************
*** 390,398 ****
      time_t additional; 
      time_t expires; 
  
-     if ( r->finfo.st_mode == 0 )
- 	return DECLINED;
- 
      /* COMMA bites my ass...
       */
      if ( conf == NULL ) {
--- 390,395 ----
***************
*** 431,436 ****
--- 428,435 ----
  
      switch (code[0]) {
  	case 'M':
+     	    if ( r->finfo.st_mode == 0 )
+ 		return DECLINED;
              base = r->finfo.st_mtime;
  	    additional = atoi( &code[1] );
  	    break;




Mime
View raw message