From 8d01dfbd33f8ac93f42bb83f4949e0caf7ee299d Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 2 Apr 2019 10:47:24 -0400 Subject: [PATCH] made it possible to use /upload/ instead of /upload/upload/ --- fileHost.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fileHost.py b/fileHost.py index 782d3dd..19a427c 100755 --- a/fileHost.py +++ b/fileHost.py @@ -389,13 +389,17 @@ def upload(): return "\n".join(urls) -@app.route("/", methods=["GET"]) +@app.route("/", methods=["GET", "POST"]) @login_required("login") def index(): """ Saves the uploaded file and returns a URL pointing to it. """ - return render_template("index.html") + if request.method == "GET": + return render_template("index.html") + else: + # so I can point my cli script to /upload/ instead of /upload/upload/ + return upload() def get_rand_chars(n):