Skip to content

Commit 435b41f

Browse files
author
Richard Jones
committed
really fix the last-modified code
1 parent 69e339f commit 435b41f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

roundup/cgi/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.230 2006-12-28 22:08:45 richard Exp $
1+
# $Id: client.py,v 1.231 2006-12-29 08:00:21 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -714,8 +714,7 @@ def _serve_file(self, lmt, mime_type, content):
714714
# spit out headers
715715
self.additional_headers['Content-Type'] = mime_type
716716
self.additional_headers['Content-Length'] = str(len(content))
717-
lmt = rfc822.formatdate(lmt)
718-
self.additional_headers['Last-Modified'] = lmt
717+
self.additional_headers['Last-Modified'] = rfc822.formatdate(lmt)
719718

720719
ims = None
721720
# see if there's an if-modified-since...
@@ -727,7 +726,7 @@ def _serve_file(self, lmt, mime_type, content):
727726
ims = self.env['HTTP_IF_MODIFIED_SINCE']
728727
if ims:
729728
ims = rfc822.parsedate(ims)[:6]
730-
lmtt = time.gmtime(ims)[:6]
729+
lmtt = time.gmtime(lmt)[:6]
731730
if lmtt <= ims:
732731
raise NotModified
733732

0 commit comments

Comments
 (0)