Skip to content

Commit

Permalink
fix proxy adding the Content-Length header twice
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Jan 25, 2012
1 parent 8fe6a03 commit 2c9c719
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4946,6 +4946,10 @@ def streamfile(url, http_meth = http_GET, bufsize=8192, data=None, progress_obj=
cl = f.info().get('Content-Length')

if cl is not None:
# sometimes the proxy adds the same header again
# which yields in value like '3495, 3495'
# use the first of these values (should be all the same)
cl = cl.split(',')[0]
cl = int(cl)

if progress_obj:
Expand Down

0 comments on commit 2c9c719

Please sign in to comment.