[http] fix: http client not hanling None 'Content-length' header

This commit is contained in:
Vinicius Moreira
2019-10-16 19:00:48 -03:00
parent cd74c554b8
commit 3f4e0ce9cb

View File

@@ -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])