summaryrefslogtreecommitdiffstats
path: root/lib/python/web_support.py
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2005-10-20 09:02:46 +0000
committerFlorian Weimer <fw@deneb.enyo.de>2005-10-20 09:02:46 +0000
commitbf34952971e03541304e01a7570fb38794dc0b21 (patch)
treefdc27bbd7b8b9bf6e6f487758040f4886738cba2 /lib/python/web_support.py
parente7df6ed88ca663c9df10193c36fcf714ddab2ef5 (diff)
r627@deneb: fw | 2005-10-14 10:33:41 +0200
lib/python/web_support.py (RedirectResult): Support non-permanent redirections. git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@2484 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib/python/web_support.py')
-rw-r--r--lib/python/web_support.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py
index 339d0963d4..cc61e826f8 100644
--- a/lib/python/web_support.py
+++ b/lib/python/web_support.py
@@ -529,8 +529,11 @@ class Result:
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):

© 2014-2024 Faster IT GmbH | imprint | privacy policy