[Secure-testing-commits] r2484 - lib/python

Florian Weimer fw at costa.debian.org
Thu Oct 20 09:02:52 UTC 2005


Author: fw
Date: 2005-10-20 09:02:46 +0000 (Thu, 20 Oct 2005)
New Revision: 2484

Modified:
   lib/python/web_support.py
Log:
 r627 at deneb:  fw | 2005-10-14 10:33:41 +0200
 lib/python/web_support.py (RedirectResult):
   Support non-permanent redirections.

Modified: lib/python/web_support.py
===================================================================
--- lib/python/web_support.py	2005-10-20 09:02:32 UTC (rev 2483)
+++ lib/python/web_support.py	2005-10-20 09:02:46 UTC (rev 2484)
@@ -529,8 +529,11 @@
 
 class RedirectResult(Result):
     """Permanently redirects the browser to a new URL."""
-    def __init__(self, url):
-        self.status = 301
+    def __init__(self, url, permanent=True):
+        if permanent:
+            self.status = 301
+        else:
+            self.status = 302
         self.url = str(url)
 
     def flatten(self, write):




More information about the Secure-testing-commits mailing list