remotes/1693045480750635534/spooky-22
Aevann1 2021-10-26 23:10:31 +02:00
parent 05b648a41d
commit 8cbd388cb1
4 changed files with 5 additions and 5 deletions

View File

@ -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()

View File

@ -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())

View File

@ -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,

View File

@ -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)