[z3-checkins] r45282 - z3/deliverance/trunk/deliverance

ianb at codespeak.net ianb at codespeak.net
Mon Jul 23 19:56:56 CEST 2007


Author: ianb
Date: Mon Jul 23 19:56:54 2007
New Revision: 45282

Modified:
   z3/deliverance/trunk/deliverance/wsgimiddleware.py
Log:
Style everything by 3xx, 204, and 401 responses

Modified: z3/deliverance/trunk/deliverance/wsgimiddleware.py
==============================================================================
--- z3/deliverance/trunk/deliverance/wsgimiddleware.py	(original)
+++ z3/deliverance/trunk/deliverance/wsgimiddleware.py	Mon Jul 23 19:56:54 2007
@@ -188,8 +188,14 @@
         if status is None:
             # non-html responses, or rebuild is not necessary: bail out 
             return body
-        if not status.startswith('200'):
-            # any non-200 response shouldn't be themed...
+        theme = True
+        status_code = status.split()[0]
+        if (status_code.startswith('3')
+            or status_code == '204'
+            or status_code == '401'):
+            # Redirects, not-modified, etc don't get themed (3xx)
+            # No Content doesn't get themed (204)
+            # Unauthorized isn't themed (401)
             start_response(status, headers)
             return body
 


More information about the z3-checkins mailing list