Commit f679304a authored by Tarek Ziade's avatar Tarek Ziade

Tolerate responses with multiple Content-Length headers - fixes #196

--HG--
branch : distribute
extra : rebase_source : b0f0f73fd59017dd9a9bb6e58b2a1fd9e5773dd2
parent c2520e2d
......@@ -579,7 +579,9 @@ class PackageIndex(Environment):
bs = self.dl_blocksize
size = -1
if "content-length" in headers:
size = int(headers["Content-Length"])
# Some servers return multiple Content-Length headers :(
content_length = headers.getheaders("Content-Length")[0]
size = int(content_length)
self.reporthook(url, filename, blocknum, bs, size)
tfp = open(filename,'wb')
while True:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment