Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: net/http/http_auth_handler_factory.cc

Issue 1157333005: [net/http auth] Use strings to identify authentication schemes. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_auth_handler_factory.h ('k') | net/http/http_auth_handler_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_factory.cc
diff --git a/net/http/http_auth_handler_factory.cc b/net/http/http_auth_handler_factory.cc
index 5a89964a80c6d47344e6ab2daa747a92b30b3305..5f24fccf3724c8533cf4d3b930dbed4c65c5b169 100644
--- a/net/http/http_auth_handler_factory.cc
+++ b/net/http/http_auth_handler_factory.cc
@@ -106,13 +106,13 @@ void HttpAuthHandlerRegistryFactory::SetURLSecurityManager(
void HttpAuthHandlerRegistryFactory::RegisterSchemeFactory(
const std::string& scheme,
HttpAuthHandlerFactory* factory) {
- std::string lower_scheme = base::ToLowerASCII(scheme);
- FactoryMap::iterator it = factory_map_.find(lower_scheme);
+ DCHECK(HttpAuth::IsValidNormalizedScheme(scheme));
+ FactoryMap::iterator it = factory_map_.find(scheme);
if (it != factory_map_.end()) {
delete it->second;
}
if (factory)
- factory_map_[lower_scheme] = factory;
+ factory_map_[scheme] = factory;
else
factory_map_.erase(it);
}
@@ -185,13 +185,12 @@ int HttpAuthHandlerRegistryFactory::CreateAuthHandler(
int digest_nonce_count,
const BoundNetLog& net_log,
scoped_ptr<HttpAuthHandler>* handler) {
- std::string scheme = challenge->scheme();
+ std::string scheme = challenge->NormalizedScheme();
if (scheme.empty()) {
handler->reset();
return ERR_INVALID_RESPONSE;
}
- std::string lower_scheme = base::ToLowerASCII(scheme);
- FactoryMap::iterator it = factory_map_.find(lower_scheme);
+ FactoryMap::iterator it = factory_map_.find(scheme);
if (it == factory_map_.end()) {
handler->reset();
return ERR_UNSUPPORTED_AUTH_SCHEME;
« no previous file with comments | « net/http/http_auth_handler_factory.h ('k') | net/http/http_auth_handler_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698