mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
Should always fallback if status code isnt 200
This commit is contained in:
parent
659c00f2ca
commit
ac0fed69e4
1 changed files with 1 additions and 2 deletions
|
@ -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")
|
||||||
|
|
Loading…
Add table
Reference in a new issue