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