hurl/integration/tests_ok/redirect.py

21 lines
457 B
Python
Raw Normal View History

from app import app
2022-10-09 17:30:07 +03:00
from flask import redirect, Response
2020-08-27 10:07:46 +03:00
2022-10-09 17:30:07 +03:00
@app.route("/redirect-absolute")
def redirect_absolute():
return redirect("http://localhost:8000/redirected")
2020-08-27 10:07:46 +03:00
2022-10-09 17:30:07 +03:00
@app.route("/redirect-relative")
def redirect_relative():
response = Response(status=302)
response.headers["Location"] = "/redirected"
response.autocorrect_location_header = False
return response
@app.route("/redirected")
2020-08-27 10:07:46 +03:00
def redirected():
2022-10-09 17:30:07 +03:00
return "Redirected"