diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 14:20:08 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 14:20:08 +0000 |
commit | f660e4be500ac5d60be46b28d4f243ba776014fb (patch) | |
tree | f1f7e267455277e3d215822eab31901b511c3d4c /net/http/http_auth_unittest.cc | |
parent | 4083d0cb10f244b52667ddfb5709e636b0780109 (diff) | |
download | chromium_src-f660e4be500ac5d60be46b28d4f243ba776014fb.zip chromium_src-f660e4be500ac5d60be46b28d4f243ba776014fb.tar.gz chromium_src-f660e4be500ac5d60be46b28d4f243ba776014fb.tar.bz2 |
HttpAuthHandlerFactory::CreateDefault requires a HostResolver argument.
Previously the default registry factory would crash if it saw a Negotiate header when trying to do a CNAME lookup because of a NULL resolver. Since then I've changed HttpAuthHandlerNegotiate to skip the CNAME lookup step when the resolver_ is NULL.
So, one option is to make CreateDefault accept an optional HostResolver argument. My concern is that since passing in NULL is the easier choice, people will do it and encounter user problems when going through a Negotiate proxy. Hence, I force the correct behavior.
BUG=56819
TEST=net_unittests, try fetch client through a Negotiate authenticating proxy.
Review URL: http://codereview.chromium.org/3518001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_unittest.cc')
-rw-r--r-- | net/http/http_auth_unittest.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/http/http_auth_unittest.cc b/net/http/http_auth_unittest.cc index a3f2b28..cc62214 100644 --- a/net/http/http_auth_unittest.cc +++ b/net/http/http_auth_unittest.cc @@ -8,6 +8,7 @@ #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/string_util.h" +#include "net/base/mock_host_resolver.h" #include "net/base/net_errors.h" #include "net/http/http_auth.h" #include "net/http/http_auth_filter.h" @@ -97,8 +98,9 @@ TEST(HttpAuthTest, ChooseBestChallenge) { GURL origin("http://www.example.com"); std::set<std::string> disabled_schemes; URLSecurityManagerAllow url_security_manager; + scoped_refptr<HostResolver> host_resolver(new MockHostResolver()); scoped_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_factory( - HttpAuthHandlerFactory::CreateDefault()); + HttpAuthHandlerFactory::CreateDefault(host_resolver)); http_auth_handler_factory->SetURLSecurityManager( "negotiate", &url_security_manager); |