diff --git a/README.md b/README.md index 09886eb..aa597af 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ FLASK_ENV=production poetry run python wsgi.py ```shell # Get clip named my_clip -curl http://example.com/raw/my_clip?pwd=my_password +curl http://example.com/raw/my_clip?my_password ``` ### Debug @@ -66,7 +66,7 @@ cd frontend yarn dev # backend cd server -poetry run python wsgi.py --debug +poetry run python wsgi.py ``` ### Backend database initailization diff --git a/server/app/resources/note.py b/server/app/resources/note.py index ca2a6d9..aaf4585 100644 --- a/server/app/resources/note.py +++ b/server/app/resources/note.py @@ -138,9 +138,11 @@ def decorated_function(*args, **kwargs): except (binascii.Error, UnicodeDecodeError): return return_json(status_code=400, message="Invalid password provided") else: - # then, try get password from query string (first try "password", then try "pwd") - plain_password = request.args.get("pwd", "") - if plain_password != "": + plain_password = "" + # then, try get password from url query (like "/raw/name?password") + if len(request.args) == 1: + plain_password = list(request.args.keys())[0] + if plain_password: password = sha512(plain_password) note = g.note