safer authorization header

pull/6179/head
Niklas Fiekas 2020-03-18 20:43:09 +01:00
parent 7851f80820
commit a555ccb1f5
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import logging
import asyncssh
import shlex
logging.basicConfig(level=logging.DEBUG)
@ -144,7 +145,8 @@ async def main():
async with asyncssh.connect("khiaw.lichess.ovh", username="root") as ssh:
logging.info(f"Downloading {url} on khiaw ...")
await ssh.run(f"wget --header=\"Authorization: token {github_api_token}\" {shlex.quote(url)}", check=True)
header = f"Authorization: {session.headers['Authorization']}"
await ssh.run(f"wget --header={shlex.quote(header)} {shlex.quote(url)}", check=True)
return 0