diff --git a/VERSION b/VERSION index c9a3333a..1dc141f8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.2.1 (2012-10-29 09:06:49) stable +Version 2.2.1 (2012-10-29 09:28:14) stable diff --git a/gluon/http.py b/gluon/http.py index 831c04d6..bd1f1411 100644 --- a/gluon/http.py +++ b/gluon/http.py @@ -140,7 +140,7 @@ class HTTP(BaseException): return self.message -def redirect(location, how=303, client_side=False): +def redirect(location='', how=303, client_side=False): if location: from gluon import current loc = location.replace('\r', '%0D').replace('\n', '%0A') @@ -150,3 +150,8 @@ def redirect(location, how=303, client_side=False): raise HTTP(how, 'You are being redirected here' % loc, Location=loc) + else: + from gluon import current + if client_side and current.request.ajax: + raise HTTP(200, **{'web2py-component-command': 'window.location.reload(true)'}) + \ No newline at end of file