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

ltucker at codespeak.net ltucker at codespeak.net
Wed Feb 7 19:14:16 CET 2007


Author: ltucker
Date: Wed Feb  7 19:14:14 2007
New Revision: 38088

Modified:
   z3/deliverance/branches/cache_aware/deliverance/wsgimiddleware.py
Log:
only del environ entries if they exist

Modified: z3/deliverance/branches/cache_aware/deliverance/wsgimiddleware.py
==============================================================================
--- z3/deliverance/branches/cache_aware/deliverance/wsgimiddleware.py	(original)
+++ z3/deliverance/branches/cache_aware/deliverance/wsgimiddleware.py	Wed Feb  7 19:14:14 2007
@@ -224,7 +224,8 @@
 	    if tag: 
                 environ['HTTP_IF_NONE_MATCH'] = tag
             else:
-	        del environ['HTTP_IF_NONE_MATCH']
+                if 'HTTP_IF_NONE_MATCH' in environ: 
+                    del environ['HTTP_IF_NONE_MATCH']
 
 
         status, headers, body = intercept_output(environ, self.app,
@@ -398,13 +399,15 @@
         if httpdate_since: 
             fetcher.environ['HTTP_IF_MODIFIED_SINCE'] = httpdate_since 
         else: 
-            del fetcher.environ['HTTP_IF_MODIFIED_SINCE']
+            if 'HTTP_IF_MODIFIED_SINCE' in fetcher.environ: 
+                del fetcher.environ['HTTP_IF_MODIFIED_SINCE']
         
 
         if etag: 
             fetcher.environ['HTTP_IF_NONE_MATCH'] = etag
         else: 
-            del fetcher.environ['HTTP_IF_NONE_MATCH']
+            if 'HTTP_IF_NONE_MATCH' in fetcher.environ: 
+                del fetcher.environ['HTTP_IF_NONE_MATCH']
 
 
         status, headers, body = fetcher.wsgi_get()


More information about the z3-checkins mailing list