Fix KeyError: 'content-length'

This commit is contained in:
Dimitris Zlatanidis 2024-01-07 19:52:57 +02:00
parent f53faa0367
commit 1ab43bdc12
2 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,9 @@
## slpkg - ChangeLog
### 4.9.7 - 07/01/2024
- Fixed:
* Fix urllib3 KeyError: 'content-length'
### 4.9.6 - 16/12/2023
- Added:
* slackdce repository (Thanks to rizitis)

View file

@ -110,7 +110,7 @@ class CheckUpdates(Configs):
f'Failed to connect to {repo_chg_txt}\n')
repo_size: int = 0
else:
repo_size: int = int(repo.headers['Content-Length'])
repo_size: int = int(repo.headers.get('content-length'))
if local_chg_txt.is_file():
local_size: int = int(os.stat(local_chg_txt).st_size)