Merge pull request #801 from dalf/fix-checker

[fix] checker: fix image fetch
This commit is contained in:
Alexandre Flament 2022-01-22 19:29:29 +01:00 committed by GitHub
commit 382f4f8fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -74,7 +74,7 @@ def _download_and_check_if_image(image_url: str) -> bool:
try:
# use "image_proxy" (avoid HTTP/2)
network.set_context_network_name('image_proxy')
stream = network.stream(
r, stream = network.stream(
'GET',
image_url,
timeout=10.0,
@ -91,7 +91,6 @@ def _download_and_check_if_image(image_url: str) -> bool:
'Cache-Control': 'max-age=0',
},
)
r = next(stream)
r.close()
if r.status_code == 200:
is_image = r.headers.get('content-type', '').startswith('image/')