From d7e1a7f179d71bbde2f890d89e6794a70933ca00 Mon Sep 17 00:00:00 2001 From: codl Date: Fri, 8 Sep 2017 00:38:54 +0200 Subject: [PATCH] mastodon login: strip protocol --- routes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes.py b/routes.py index 9bd8a52..98dd5ea 100644 --- a/routes.py +++ b/routes.py @@ -16,6 +16,7 @@ import version import lib.version import lib.settings import lib.json +import re @app.before_request @@ -275,6 +276,8 @@ def mastodon_login_step1(instance=None): generic_error='error' in request.args ) + instance_url = re.sub('^https?://', '', instance_url, + count=1, flags=re.IGNORECASE) instance_url = instance_url.split("@")[-1].lower() callback = url_for('mastodon_login_step2', @@ -349,6 +352,7 @@ def delete_reason(): db.session.commit() return jsonify(status='success') + @app.route('/api/badge/users') def users_badge(): count = (