Skip to content

Commit

Permalink
Use first Content-length header (bug 1226)
Browse files Browse the repository at this point in the history
Use first matching Content-length header when multiple
found. Occured with some cache/proxy servers.
  • Loading branch information
hanula authored and thp committed Dec 16, 2010
1 parent c183a73 commit 8f84d07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gpodder/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def retrieve_resume(self, url, filename, reporthook=None, data=None):
blocknum = int(current_size/bs)
if reporthook:
if "content-length" in headers:
size = int(headers["Content-Length"]) + current_size
size = int(headers.getrawheader("Content-Length")) + current_size
reporthook(blocknum, bs, size)
while read < size or size == -1:
if size == -1:
Expand Down

0 comments on commit 8f84d07

Please sign in to comment.