[FIX] http: force removing the debug in redirection

In case of local_redirect with
* forward_debug=False
* qwery={'debug': True}

the debug mode should be removed.

cf discusion on #12107 and dd4980b0
This commit is contained in:
Martin Trigaux 2016-06-13 14:30:29 +02:00
parent 6817c48a8b
commit de78b1b3da
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 5 additions and 2 deletions

View File

@ -141,8 +141,11 @@ def local_redirect(path, query=None, keep_hash=False, forward_debug=True, code=3
url = path
if not query:
query = {}
if forward_debug and request and request.debug:
query['debug'] = ''
if request and request.debug:
if forward_debug:
query['debug'] = ''
else:
query['debug'] = None
if query:
url += '?' + werkzeug.url_encode(query)
if keep_hash: