From 96d7ba1a9ea309130323b9f751f9493e9fe8b4c4 Mon Sep 17 00:00:00 2001 From: bretello Date: Fri, 14 Jun 2024 19:56:12 +0200 Subject: [PATCH] add 301 redirect on successful upload --- app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 2e19e31..4b91552 100644 --- a/app.py +++ b/app.py @@ -81,7 +81,11 @@ def upload_file(): thread.start() 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/", methods=["GET"])