def get_auth_header(self, host):
auth = None
for domain, creds in self.gitcookies.iteritems():
if cookielib.domain_match(host, domain):
auth = (creds[0], None, creds[1])
break
if not auth:
auth = self.netrc.authenticators(host)
if auth:
return 'Basic %s' % (base64.b64encode('%s:%s' % (auth[0], auth[2])))
return None
# Backwards compatibility just in case somebody imports this outside of
# depot_tools.
评论列表
文章目录