aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/bootstrap_commands.py
diff options
context:
space:
mode:
authorS <pathway27@gmail.com>2016-08-16 04:06:41 +0000
committerS <pathway27@gmail.com>2016-08-16 04:09:10 +0000
commit8e12e3ce682650393965844077f428928d9f0db0 (patch)
treeff9ce9a8d344888f95afb8733cb41b77d24d0b05 /python/servo/bootstrap_commands.py
parentc3d118a45e75ec8221b0c102b528ddd93656241d (diff)
downloadservo-8e12e3ce682650393965844077f428928d9f0db0.tar.gz
servo-8e12e3ce682650393965844077f428928d9f0db0.zip
Fix overriding url with Request obj. when resuming download
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r--python/servo/bootstrap_commands.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index a3b997c2e69..bd074b41dec 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -37,9 +37,10 @@ def download(desc, src, writer, start_byte=0):
dumb = (os.environ.get("TERM") == "dumb") or (not sys.stdout.isatty())
try:
+ req = urllib2.Request(src)
if start_byte:
- src = urllib2.Request(src, headers={'Range': 'bytes={}-'.format(start_byte)})
- resp = urllib2.urlopen(src)
+ req = urllib2.Request(src, headers={'Range': 'bytes={}-'.format(start_byte)})
+ resp = urllib2.urlopen(req)
fsize = None
if resp.info().getheader('Content-Length'):