(self, authreq, host, req, headers)
| 956 | yield (scheme, None) |
| 957 | |
| 958 | def http_error_auth_reqed(self, authreq, host, req, headers): |
| 959 | # host may be an authority (without userinfo) or a URL with an |
| 960 | # authority |
| 961 | headers = headers.get_all(authreq) |
| 962 | if not headers: |
| 963 | # no header found |
| 964 | return |
| 965 | |
| 966 | unsupported = None |
| 967 | for header in headers: |
| 968 | for scheme, realm in self._parse_realm(header): |
| 969 | if scheme.lower() != 'basic': |
| 970 | unsupported = scheme |
| 971 | continue |
| 972 | |
| 973 | if realm is not None: |
| 974 | # Use the first matching Basic challenge. |
| 975 | # Ignore following challenges even if they use the Basic |
| 976 | # scheme. |
| 977 | return self.retry_http_basic_auth(host, req, realm) |
| 978 | |
| 979 | if unsupported is not None: |
| 980 | raise ValueError("AbstractBasicAuthHandler does not " |
| 981 | "support the following scheme: %r" |
| 982 | % (scheme,)) |
| 983 | |
| 984 | def retry_http_basic_auth(self, host, req, realm): |
| 985 | user, pw = self.passwd.find_user_password(realm, host) |
no test coverage detected