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
|
||||
|
||||
|
||||
def redirect(location, how=303, type=None):
|
||||
from gluon import current
|
||||
type = type or ('client' if current.request.ajax else 'http')
|
||||
def redirect(location, how=303, type='http'):
|
||||
if type=='auto':
|
||||
from gluon import current
|
||||
type = 'client' if current.request.ajax else 'http'
|
||||
if not location:
|
||||
return
|
||||
location = location.replace('\r', '%0D').replace('\n', '%0A')
|
||||
|
||||
Reference in New Issue
Block a user