From 8dec93d087d1083c22d29a49bcc418c81f17dc76 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sat, 2 Nov 2019 01:14:28 -0700 Subject: [PATCH] Fix vote parsing --- webapp/titanembeds/blueprints/api/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index ecfac35..b446584 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -605,12 +605,12 @@ def list_users(guild_id): def webhook_discordbotsorg_vote(): incoming = request.get_json() client_id = incoming.get('bot') - if config["client-id"] != client_id: + if str(config["client-id"]) != str(client_id): abort(401) - if request.headers.get("Authorization", "") != config.get("discordbotsorg-webhook-secret", ""): + if str(request.headers.get("Authorization", "")) != str(config.get("discordbotsorg-webhook-secret", "")): abort(403) - user_id = incoming.get("user") - vote_type = incoming.get("type") + user_id = str(incoming.get("user")) + vote_type = str(incoming.get("type")) params = dict(parse_qsl(urlsplit(incoming.get("query", "")).query)) if vote_type == "upvote": redis_store.set("DiscordBotsOrgVoted/" + user_id, "voted", 86400)