mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Fix overriding url with Request obj. when resuming download
This commit is contained in:
parent
c3d118a45e
commit
8e12e3ce68
1 changed files with 3 additions and 2 deletions
|
@ -37,9 +37,10 @@ def download(desc, src, writer, start_byte=0):
|
||||||
dumb = (os.environ.get("TERM") == "dumb") or (not sys.stdout.isatty())
|
dumb = (os.environ.get("TERM") == "dumb") or (not sys.stdout.isatty())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
req = urllib2.Request(src)
|
||||||
if start_byte:
|
if start_byte:
|
||||||
src = urllib2.Request(src, headers={'Range': 'bytes={}-'.format(start_byte)})
|
req = urllib2.Request(src, headers={'Range': 'bytes={}-'.format(start_byte)})
|
||||||
resp = urllib2.urlopen(src)
|
resp = urllib2.urlopen(req)
|
||||||
|
|
||||||
fsize = None
|
fsize = None
|
||||||
if resp.info().getheader('Content-Length'):
|
if resp.info().getheader('Content-Length'):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue