Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock committed Mar 11, 2024
1 parent 2068282 commit c7c4a88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def edit_temp_json():
def config(url):
user_agent = request.headers.get('User-Agent')
rua_values = os.getenv('RUA').split(',')
substrings = os.getenv('STR').split(',')
if any(rua_value in user_agent for rua_value in rua_values):
return Response(json.dumps({'status': 'error', 'message': 'block'}, indent=4, ensure_ascii=False),
content_type='application/json; charset=utf-8', status=403)
substrings = os.getenv('STR').split(',')
if any(substring in url for substring in substrings):
return Response(json.dumps({'status': 'error', 'message_CN': '填写参数不符合规范'}, indent=4, ensure_ascii=False),
content_type='application/json; charset=utf-8', status=403)
Expand Down

0 comments on commit c7c4a88

Please sign in to comment.