@app.route('/redirect/<int:n>')
def redirect_n_times(request, n):
    n = int(n)
    assert n > 0

    absolute = request.args.get('absolute', 'false').lower() == 'true'

    if n == 1:
        return redirect(app.url_for('view_get', _request=request,
                                    _external=absolute))

    if absolute:
        return _redirect(request, 'absolute', n, True)
    else:
        return _redirect(request, 'relative', n, False)
302 Redirects n times.
dataset/ETHPy150Open mozillazg/bustard/tests/httpbin/core.py/redirect_n_times