1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

fix proxy adding the Content-Length header twice

This commit is contained in:
Pavol Rusnak 2012-01-25 14:58:55 +01:00
parent 8fe6a030ef
commit 2c9c719c9e

View File

@ -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: