From 3f4e0ce9cbda436fb3db0f11afbb337a0b81bb94 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Wed, 16 Oct 2019 19:00:48 -0300 Subject: [PATCH] [http] fix: http client not hanling None 'Content-length' header --- bauh/api/http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bauh/api/http.py b/bauh/api/http.py index 4e685f6f..4d447d17 100644 --- a/bauh/api/http.py +++ b/bauh/api/http.py @@ -61,9 +61,10 @@ class HttpClient: res = self.session.get(url, allow_redirects=True, stream=True) if res.status_code == 200: - size = int(res.headers.get('Content-Length')) + size = res.headers.get('Content-Length') if size is not None: + size = int(size) for m in SIZE_MULTIPLIERS: size_str = str(size * m[0])