fixed redirection bug

This commit is contained in:
mdipierro
2014-08-08 00:07:34 -05:00
parent 535a39feaa
commit 6fc97775dc
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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
View File
@@ -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)