first
This commit is contained in:
parent
8e3e7e1d3d
commit
be13e954bd
6 changed files with 6 additions and 6 deletions
|
@ -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()
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 632 KiB |
File diff suppressed because one or more lines are too long
|
@ -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())
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue