Index: net/http/http_auth.cc |
diff --git a/net/http/http_auth.cc b/net/http/http_auth.cc |
index 77b5bdcf472390eaa6d263f035832e64d205ccf4..295a988b5bc58c6ba2a4400292bcf415ab276ede 100644 |
--- a/net/http/http_auth.cc |
+++ b/net/http/http_auth.cc |
@@ -108,9 +108,16 @@ void HttpAuth::ChooseBestChallenge( |
// rare. Servers typically specify higher priority schemes before lower |
// priority schemes. |
scoped_ptr<HttpAuthHandler> current_handler; |
- int rv = http_auth_handler_factory->CreateAuthHandler( |
- challenge_tokenizer, target, origin, |
- HttpAuthHandlerFactory::CREATE_CHALLENGE, 1, net_log, ¤t_handler); |
+ current_handler = http_auth_handler_factory->CreateAuthHandlerForScheme( |
+ challenge_tokenizer.NormalizedScheme()); |
+ if (!current_handler) { |
+ net_log.AddEvent(NetLog::TYPE_AUTH_HANDLER_CREATION_FAILURE, |
+ base::Bind(&AuthHandlerCreationFailureParams, |
+ &cur_challenge, ERR_UNSUPPORTED_AUTH_SCHEME)); |
+ continue; |
+ } |
+ int rv = current_handler->HandleInitialChallenge(challenge_tokenizer, |
+ target, origin, net_log); |
if (rv != OK) { |
net_log.AddEvent( |
NetLog::TYPE_AUTH_HANDLER_CREATION_FAILURE, |