This commit is contained in:
Michel Oosterhof
2015-10-07 23:17:06 +04:00
parent e91c23eb7e
commit b5646b2dff
2 changed files with 4 additions and 4 deletions

View File

@@ -209,11 +209,11 @@ class HTTPProgressDownloader(client.HTTPDownloader):
def gotHeaders(self, headers):
if self.status == '200':
#self.curl.writeln('200 OK')
if headers.has_key('content-length'):
if 'content-length' in headers:
self.totallength = int(headers['content-length'][0])
else:
self.totallength = 0
if headers.has_key('content-type'):
if 'content-type' in headers:
self.contenttype = headers['content-type'][0]
else:
self.contenttype = 'text/whatever'

View File

@@ -215,11 +215,11 @@ class HTTPProgressDownloader(client.HTTPDownloader):
if self.status == '200':
if self.quiet == False:
self.wget.writeln('200 OK')
if headers.has_key('content-length'):
if 'content-length' in headers:
self.totallength = int(headers['content-length'][0])
else:
self.totallength = 0
if headers.has_key('content-type'):
if 'content-type' in headers:
self.contenttype = headers['content-type'][0]
else:
self.contenttype = 'text/whatever'