This commit is contained in:
Valentin Lorentz 2012-10-23 16:15:13 +00:00
parent 3a78300971
commit 85eb0b4b0d
1 changed files with 3 additions and 2 deletions

View File

@ -116,6 +116,7 @@ def getUrlFd(url, headers=None, data=None):
auth, url = url.split('@') auth, url = url.split('@')
url = scheme + '://' + url url = scheme + '://' + url
request = urllib2.Request(url, headers=headers, data=data) request = urllib2.Request(url, headers=headers, data=data)
if 'auth' in locals():
request.add_header('Authorization', request.add_header('Authorization',
'Basic ' + base64.b64encode(auth)) 'Basic ' + base64.b64encode(auth))
else: else: