[z3-checkins] r38228 - z3/deliverance/branches/cache_aware/deliverance

ltucker at codespeak.net ltucker at codespeak.net
Fri Feb 9 02:38:16 CET 2007


Author: ltucker
Date: Fri Feb  9 02:38:14 2007
New Revision: 38228

Modified:
   z3/deliverance/branches/cache_aware/deliverance/cache_utils.py
Log:
only compute last-modified if all elements have a last-modified

Modified: z3/deliverance/branches/cache_aware/deliverance/cache_utils.py
==============================================================================
--- z3/deliverance/branches/cache_aware/deliverance/cache_utils.py	(original)
+++ z3/deliverance/branches/cache_aware/deliverance/cache_utils.py	Fri Feb  9 02:38:14 2007
@@ -52,6 +52,8 @@
     last_mod = merge_last_modified_from_headers(headers_map)
     if last_mod is not None: 
         replace_header(new_headers, 'last-modified', last_mod)
+    else: 
+    	remove_header(new_headers, 'last-modified')
 
 
 
@@ -125,7 +127,9 @@
     accepts a map from uris to wsgi-style header lists 
     returns the value for the last-modified header
     representing the latest modification date present 
-    in any of the header lists 
+    in any of the header lists. If any header set does
+    not specify a last-modified date, the result is 
+    None.
     """
     latest_mod = None 
     for uri, headers in headers_map.items(): 
@@ -136,6 +140,8 @@
                 latest_mod = mod_secs
             elif mod_secs > latest_mod: 
                 latest_mod = mod_secs
+	else:
+	    return None
     if latest_mod is not None: 
         tmp = []
         LAST_MODIFIED.update(tmp, time=latest_mod)


More information about the z3-checkins mailing list