def make_redirect(): ''' Return a flask.redirect for the current flask.request. ''' referer_url = request.headers.get('Referer') other = redirect(get_redirect(request.path, referer_url), 302) other.headers['Cache-Control'] = 'no-store private' other.headers['Vary'] = 'Referer' return other
def make_redirect(slash_count): ''' Return a flask.redirect for the current flask.request. ''' referer_url = request.headers.get('Referer') request_part = request.path + '?{}'.format(request.query_string).rstrip('?') location = get_redirect(request_part, referer_url, slash_count) other = redirect(absolute_url(request, location), 302) other.headers['Cache-Control'] = 'no-store private' other.headers['Vary'] = 'Referer' return other