def _get_auth_failure_detail(self, response): """Search thru ```response```'s headers and if the auth failure detail header is found return a tuple that's the auth failure detail header's name and value.""" for key, value in response.headers.iteritems(): if auth_failure_detail_header_name.lower() == key.lower(): return (key, value) return (None, None)
def _get_auth_failure_debug_details(self, response): """Search thru ```response```'s headers and extract all auth failure debug headers found return as a dict with header's name as dict's key and header's value as the corresponding value.""" # :TODO: look at all the 'lower()' calls in the code below! # What is DAS doing wrong? rv = {} for key, value in response.headers.iteritems(): if key.lower().startswith(debug_header_prefix.lower()): if auth_failure_detail_header_name.lower() != key.lower(): rv[key[len(debug_header_prefix):].lower()] = value return rv