-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.patch
26 lines (25 loc) · 982 Bytes
/
server.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/__init__.py b/__init__.py
index 6d9197d..3afe216 100644
--- a/__init__.py
+++ b/__init__.py
@@ -443,7 +443,7 @@ class BrowseHandler(webapp.RequestHandler):
except errors.Redirect as e :
if conf["viur.debug.traceExceptions"]:
raise
- self.redirect( e.url.encode("UTF-8") )
+ self.redirect( e.url.encode("UTF-8"), code=e.status )
except errors.HTTPException as e:
if conf["viur.debug.traceExceptions"]:
raise
diff --git a/errors.py b/errors.py
index c0becd0..2f1437b 100644
--- a/errors.py
+++ b/errors.py
@@ -38,7 +38,7 @@ class Redirect( HTTPException ):
Causes an 303 - See Other (or 302 - Found if requested / 301 - Moved Permanently) redirect
"""
def __init__( self, url, descr="Redirect", status=303 ):
- super( Redirect, self ).__init__( status=303, name = "Redirect", descr=descr )
+ super( Redirect, self ).__init__( status=status, name = "Redirect", descr=descr )
self.url = url
class Unauthorized( HTTPException ):