mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 03:34:15 +02:00
[api] fix: crashing when trying to retrieve a file size without proving its URL
This commit is contained in:
@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
### Fixes
|
||||
- General
|
||||
- more fixes related to some backend commands hanging
|
||||
- crashing when trying to retrieve a file size without proving its URL [#207](https://github.com/vinifmor/bauh/issues/207)
|
||||
|
||||
- Flatpak
|
||||
- not displaying update components not associated with installed packages
|
||||
- not displaying the updates size for Flatpak 1.2
|
||||
|
||||
@@ -69,6 +69,9 @@ class HttpClient:
|
||||
return yaml.safe_load(res.text) if res else None
|
||||
|
||||
def get_content_length_in_bytes(self, url: str, session: bool = True) -> Optional[int]:
|
||||
if not url:
|
||||
return None
|
||||
|
||||
params = {'url': url, 'allow_redirects': True, 'stream': True}
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user