class HTTParty::Request

def response_has_digest_auth_challenge?

def response_has_digest_auth_challenge?
  !last_response['www-authenticate'].nil? && last_response['www-authenticate'].length > 0
end