redirect(...,type='auto')
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-08-08 10:23:01) dev
|
Version 2.00.0 (2012-08-08 12:17:50) dev
|
||||||
|
|||||||
+4
-3
@@ -119,9 +119,10 @@ class HTTP(BaseException):
|
|||||||
return self.message
|
return self.message
|
||||||
|
|
||||||
|
|
||||||
def redirect(location, how=303, type=None):
|
def redirect(location, how=303, type='http'):
|
||||||
from gluon import current
|
if type=='auto':
|
||||||
type = type or ('client' if current.request.ajax else 'http')
|
from gluon import current
|
||||||
|
type = 'client' if current.request.ajax else 'http'
|
||||||
if not location:
|
if not location:
|
||||||
return
|
return
|
||||||
location = location.replace('\r', '%0D').replace('\n', '%0A')
|
location = location.replace('\r', '%0D').replace('\n', '%0A')
|
||||||
|
|||||||
Reference in New Issue
Block a user