mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[fix] shadowing variable name
This commit is contained in:
parent
2bda81c59f
commit
4b9b1ff98e
1 changed files with 2 additions and 2 deletions
4
run.py
4
run.py
|
@ -339,8 +339,8 @@ def require_token():
|
||||||
api_logger.warning("No tokens available and a user is trying to access the API")
|
api_logger.warning("No tokens available and a user is trying to access the API")
|
||||||
return response.json({'status': 'invalide token'}, 403)
|
return response.json({'status': 'invalide token'}, 403)
|
||||||
|
|
||||||
async with aiofiles.open('tokens', mode='r') as f:
|
async with aiofiles.open('tokens', mode='r') as file:
|
||||||
tokens = await f.read()
|
tokens = await file.read()
|
||||||
tokens = {x.strip() for x in tokens.split("\n") if x.strip()}
|
tokens = {x.strip() for x in tokens.split("\n") if x.strip()}
|
||||||
|
|
||||||
token = request.headers["X-Token"].strip()
|
token = request.headers["X-Token"].strip()
|
||||||
|
|
Loading…
Add table
Reference in a new issue