add 301 redirect on successful upload

This commit is contained in:
bretello 2024-06-14 19:56:12 +02:00
parent d5877058e3
commit 96d7ba1a9e
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

6
app.py
View File

@ -81,7 +81,11 @@ def upload_file():
thread.start() thread.start()
print(f"thread started for {file.filename=}") print(f"thread started for {file.filename=}")
return "File uploaded successfully" response = make_response(make_response("file uploaded succesfully", 301))
response.headers["Location"] = "/"
response.status_code = 301
return response
@app.route("/run/<string:cassetta>", methods=["GET"]) @app.route("/run/<string:cassetta>", methods=["GET"])