diff --git a/files/__main__.py b/files/__main__.py index ff25aff56..95628b7db 100755 --- a/files/__main__.py +++ b/files/__main__.py @@ -92,7 +92,7 @@ def before_request(): if request.method.lower() != "get" and app.config["READ_ONLY"]: return {"error":f"{app.config['SITE_NAME']} is currently in read-only mode."}, 500 - if app.config["BOT_DISABLE"] and request.headers.get("X-User-Type")=="Bot": abort(503) + if app.config["BOT_DISABLE"] and request.headers.get("Authorization"): abort(503) g.db = db_session() diff --git a/files/routes/comments.py b/files/routes/comments.py index 427d70d51..99744df88 100755 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -201,7 +201,7 @@ def api_comment(v): if parent.author.any_block_exists(v) and not v.admin_level>=3: return {"error": "You can't reply to users who have blocked you, or users you have blocked."}, 403 - is_bot = request.headers.get("X-User-Type","")=="Bot" + is_bot = request.headers.get("Authorization") if not is_bot and 'trans lives matters' not in body.lower(): now = int(time.time()) diff --git a/files/routes/posts.py b/files/routes/posts.py index 095b96cf6..a5f2926dc 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -664,7 +664,7 @@ def submit_post(v): author_id=v.id, over_18=bool(request.values.get("over_18","")), app_id=v.client.application.id if v.client else None, - is_bot = request.headers.get("X-User-Type","").lower()=="bot", + is_bot = request.headers.get("Authorization"), url=url, body=body, body_html=body_html, diff --git a/files/routes/votes.py b/files/routes/votes.py index 9afbbc8bb..839e77b36 100755 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -62,7 +62,7 @@ def api_vote_post(post_id, new, v): if new not in ["-1", "0", "1"]: abort(400) - if request.headers.get("X-User-Type","") == "Bot": abort(403) + if request.headers.get("Authorization"): abort(403) new = int(new) @@ -130,7 +130,7 @@ def api_vote_comment(comment_id, new, v): if new not in ["-1", "0", "1"]: abort(400) - if request.headers.get("X-User-Type","") == "Bot": abort(403) + if request.headers.get("Authorization"): abort(403) new = int(new)