(self, host, req, realm)
| 980 | % (scheme,)) |
| 981 | |
| 982 | def retry_http_basic_auth(self, host, req, realm): |
| 983 | user, pw = self.passwd.find_user_password(realm, host) |
| 984 | if pw is not None: |
| 985 | raw = "%s:%s" % (user, pw) |
| 986 | auth = "Basic " + base64.b64encode(raw.encode()).decode("ascii") |
| 987 | if req.get_header(self.auth_header, None) == auth: |
| 988 | return None |
| 989 | req.add_unredirected_header(self.auth_header, auth) |
| 990 | return self.parent.open(req, timeout=req.timeout) |
| 991 | else: |
| 992 | return None |
| 993 | |
| 994 | def http_request(self, req): |
| 995 | if (not hasattr(self.passwd, 'is_authenticated') or |
no test coverage detected