From 3998d4ed68e9e4008a88628d47156156b55735ec Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 27 Oct 2019 14:49:57 +0100 Subject: [PATCH] Micropub query configuration support --- blueprints/api.py | 8 +++++++- blueprints/indieauth.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/blueprints/api.py b/blueprints/api.py index c001737..3bc6d4a 100644 --- a/blueprints/api.py +++ b/blueprints/api.py @@ -439,9 +439,15 @@ def api_remove_from_list() -> _Response: return _user_api_response() -@blueprint.route("/new_note", methods=["POST"]) # noqa: C901 too complex +@blueprint.route("/new_note", methods=["POST", "GET"]) # noqa: C901 too complex @api_required def api_new_note() -> _Response: + # Basic Micropub (https://www.w3.org/TR/micropub/) query configuration support + if request.method == "GET" and request.args.get("q") == "config": + return jsonify({}) + elif request.method == "GET": + abort(405) + source = None summary = None diff --git a/blueprints/indieauth.py b/blueprints/indieauth.py index 76ee66c..68e64dd 100644 --- a/blueprints/indieauth.py +++ b/blueprints/indieauth.py @@ -91,7 +91,7 @@ def indieauth_flow(): def indieauth_endpoint(): if request.method == "GET": if not session.get("logged_in"): - return redirect(url_for("admin_login", next=request.url)) + return redirect(url_for("admin.admin_login", redirect=request.url)) me = request.args.get("me") # FIXME(tsileo): ensure me == ID