mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 23:24: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
|
### Fixes
|
||||||
- General
|
- General
|
||||||
- more fixes related to some backend commands hanging
|
- 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
|
- Flatpak
|
||||||
- not displaying update components not associated with installed packages
|
- not displaying update components not associated with installed packages
|
||||||
- not displaying the updates size for Flatpak 1.2
|
- 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
|
return yaml.safe_load(res.text) if res else None
|
||||||
|
|
||||||
def get_content_length_in_bytes(self, url: str, session: bool = True) -> Optional[int]:
|
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}
|
params = {'url': url, 'allow_redirects': True, 'stream': True}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user