Correction gestion du cache

This commit is contained in:
Emmy D'Anello 2024-06-16 07:35:15 +02:00
parent db3367b364
commit 81c72ff197
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -20,6 +20,8 @@ def get_file(url, filename, force_etag: str = ""):
if symlink_file.exists(): if symlink_file.exists():
file = symlink_file.resolve() file = symlink_file.resolve()
etag = file.name etag = file.name
if etag == force_etag:
return file
response = requests.get(url, headers={"If-None-Match": f'"{etag}'}, allow_redirects=True) response = requests.get(url, headers={"If-None-Match": f'"{etag}'}, allow_redirects=True)
if response.status_code == 404: if response.status_code == 404: