fixed redirection bug
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.9.5-trunk+timestamp.2014.08.07.23.54.11
|
||||
Version 2.9.5-trunk+timestamp.2014.08.08.00.05.49
|
||||
|
||||
+2
-1
@@ -163,10 +163,11 @@ def redirect(location='', how=303, client_side=False, headers=None):
|
||||
if location:
|
||||
from gluon import current
|
||||
loc = location.replace('\r', '%0D').replace('\n', '%0A')
|
||||
headers['web2py-redirect-location'] = loc
|
||||
if client_side and current.request.ajax:
|
||||
headers['web2py-redirect-location'] = loc
|
||||
raise HTTP(200, **headers)
|
||||
else:
|
||||
headers['Location'] = loc
|
||||
raise HTTP(how,
|
||||
'You are being redirected <a href="%s">here</a>' % loc,
|
||||
**headers)
|
||||
|
||||
Reference in New Issue
Block a user