From 6fc97775dc8d7b53f23e4f1a8224f1923a53fe09 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 8 Aug 2014 00:07:34 -0500 Subject: [PATCH] fixed redirection bug --- VERSION | 2 +- gluon/http.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 1a25e95c..409a0231 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/http.py b/gluon/http.py index 91013b2d..ee25c006 100644 --- a/gluon/http.py +++ b/gluon/http.py @@ -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 here' % loc, **headers)