From 4546d7cfd9fba1e01641452b4137cfd2183d6fec Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Mon, 31 Jan 2022 10:13:43 -0500 Subject: tools/adoptopenjdk-manifest: add follow_redirects, raise_for_status --- tools/adoptopenjdk-manifest | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/adoptopenjdk-manifest b/tools/adoptopenjdk-manifest index 1789fdf..c286527 100755 --- a/tools/adoptopenjdk-manifest +++ b/tools/adoptopenjdk-manifest @@ -10,14 +10,16 @@ import httpx import portage async def do_manifest(client, filename, size, url): - resp = await client.get(f'{url}.sha256.txt') + resp = await client.get(f'{url}.sha256.txt', follow_redirects=True) + resp.raise_for_status() sha256 = resp.text.split(' ')[0] return (filename, size, sha256) async def do_api(client, ghauth, tagl): owner, repo, tag = tagl apiurl = f'https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}' - resp = await client.get(apiurl, auth=ghauth) + resp = await client.get(apiurl, auth=ghauth, follow_redirects=True) + resp.raise_for_status() return {asset['browser_download_url']: asset['size'] for asset in resp.json()['assets']} -- cgit v1.2.3-70-g09d2