From: richard Date: Fri, 7 Mar 2003 21:51:31 +0000 (+0000) Subject: better if-modified-since handling for cgi-bin X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=54475918cdefb1a8fd07b1177a79b4a1727239b7;p=roundup.git better if-modified-since handling for cgi-bin git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1574 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 8f4bf01..8d42592 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.101 2003-02-27 05:43:01 richard Exp $ +# $Id: client.py,v 1.102 2003-03-07 21:51:31 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -443,9 +443,10 @@ class Client: def serve_static_file(self, file): # see if there's an if-modified-since... - ims = self.request.headers.getheader('if-modified-since') - # cgi will put the header in the env var - if not ims and self.env.has_key('HTTP_IF_MODIFIED_SINCE'): + if hasattr(self.request, 'headers'): + ims = self.request.headers.getheader('if-modified-since') + elif self.env.has_key('HTTP_IF_MODIFIED_SINCE'): + # cgi will put the header in the env var ims = self.env['HTTP_IF_MODIFIED_SINCE'] filename = os.path.join(self.instance.config.TEMPLATES, file) lmt = os.stat(filename)[stat.ST_MTIME]