Should always fallback if status code isnt 200

This commit is contained in:
Solirs 2023-03-22 22:39:31 +01:00
parent 659c00f2ca
commit ac0fed69e4

View file

@ -332,8 +332,7 @@ def get_favicon_or_logo(imgtype: str):
resp, stream = http_stream(method='GET', url=path, headers=request_headers, allow_redirects=True) resp, stream = http_stream(method='GET', url=path, headers=request_headers, allow_redirects=True)
if resp.status_code != 200: if resp.status_code != 200:
logger.debug(f"{imgtype}: Bad status code %i", resp.status_code) logger.debug(f"{imgtype}: Bad status code %i", resp.status_code)
if resp.status_code >= 400: return fallback
return fallback
resp_ok = True resp_ok = True
except httpx.HTTPError: except httpx.HTTPError:
logger.debug(f"{imgtype}: HTTP error") logger.debug(f"{imgtype}: HTTP error")