Index: net/http/http_auth_controller.cc |
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc |
index 5c3d3a578e1947c1e0cca5439cc9ecdba2d134f6..bc736fbe1e8044ed206ad2add81aee4329d62ec2 100644 |
--- a/net/http/http_auth_controller.cc |
+++ b/net/http/http_auth_controller.cc |
@@ -24,35 +24,6 @@ namespace net { |
namespace { |
-// Returns a log message for all the response headers related to the auth |
-// challenge. |
-std::string AuthChallengeLogMessage(HttpResponseHeaders* headers) { |
- std::string msg; |
- std::string header_val; |
- size_t iter = 0; |
- while (headers->EnumerateHeader(&iter, "proxy-authenticate", &header_val)) { |
- msg.append("\n Has header Proxy-Authenticate: "); |
- msg.append(header_val); |
- } |
- |
- iter = 0; |
- while (headers->EnumerateHeader(&iter, "www-authenticate", &header_val)) { |
- msg.append("\n Has header WWW-Authenticate: "); |
- msg.append(header_val); |
- } |
- |
- // RFC 4559 requires that a proxy indicate its support of NTLM/Negotiate |
- // authentication with a "Proxy-Support: Session-Based-Authentication" |
- // response header. |
- iter = 0; |
- while (headers->EnumerateHeader(&iter, "proxy-support", &header_val)) { |
- msg.append("\n Has header Proxy-Support: "); |
- msg.append(header_val); |
- } |
- |
- return msg; |
-} |
- |
enum AuthEvent { |
AUTH_EVENT_START = 0, |
AUTH_EVENT_REJECT, |
@@ -246,16 +217,13 @@ void HttpAuthController::AddAuthorizationHeader( |
} |
int HttpAuthController::HandleAuthChallenge( |
- scoped_refptr<HttpResponseHeaders> headers, |
+ const HttpResponseInfo& response_info, |
bool do_not_send_server_auth, |
bool establishing_tunnel, |
const BoundNetLog& net_log) { |
DCHECK(CalledOnValidThread()); |
- DCHECK(headers.get()); |
+ DCHECK(response_info.headers.get()); |
DCHECK(auth_origin_.is_valid()); |
- VLOG(1) << "The " << HttpAuth::GetAuthTargetString(target_) << " " |
- << auth_origin_ << " requested auth " |
- << AuthChallengeLogMessage(headers.get()); |
// Give the existing auth handler first try at the authentication headers. |
// This will also evict the entry in the HttpAuthCache if the previous |
@@ -263,12 +231,9 @@ int HttpAuthController::HandleAuthChallenge( |
// case. |
if (HaveAuth()) { |
std::string challenge_used; |
- HttpAuth::AuthorizationResult result = |
- HttpAuth::HandleChallengeResponse(handler_.get(), |
- headers.get(), |
- target_, |
- disabled_schemes_, |
- &challenge_used); |
+ HttpAuth::AuthorizationResult result = HttpAuth::HandleChallengeResponse( |
+ handler_.get(), response_info, target_, disabled_schemes_, |
+ &challenge_used); |
switch (result) { |
case HttpAuth::AUTHORIZATION_RESULT_ACCEPT: |
break; |
@@ -317,24 +282,15 @@ int HttpAuthController::HandleAuthChallenge( |
do { |
if (!handler_.get() && can_send_auth) { |
// Find the best authentication challenge that we support. |
- HttpAuth::ChooseBestChallenge(http_auth_handler_factory_, |
- headers.get(), |
- target_, |
- auth_origin_, |
- disabled_schemes_, |
- net_log, |
- &handler_); |
+ HttpAuth::ChooseBestChallenge(http_auth_handler_factory_, response_info, |
+ target_, auth_origin_, disabled_schemes_, |
+ net_log, &handler_); |
if (handler_.get()) |
HistogramAuthEvent(handler_.get(), AUTH_EVENT_START); |
} |
if (!handler_.get()) { |
if (establishing_tunnel) { |
- LOG(ERROR) << "Can't perform auth to the " |
- << HttpAuth::GetAuthTargetString(target_) << " " |
- << auth_origin_ << " when establishing a tunnel" |
- << AuthChallengeLogMessage(headers.get()); |
- |
// We are establishing a tunnel, we can't show the error page because an |
// active network attacker could control its contents. Instead, we just |
// fail to establish the tunnel. |