From 66a14c5eb51e3280ca58d148a01844c4b2ceea9b Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Fri, 16 Oct 2015 16:43:03 -0700 Subject: [PATCH] Fallback to default behavior if boolean is false --- brightray/browser/url_request_context_getter.cc | 12 +++++++++--- brightray/browser/url_request_context_getter.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 58df7ece65..bc42f8e460 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -84,14 +84,20 @@ const char kProxyPacUrl[] = "proxy-pac-url"; } // namespace -ExplicitURLSecurityManager::ExplicitURLSecurityManager() : allow_default_creds_(false) {} +ExplicitURLSecurityManager::ExplicitURLSecurityManager() : + allow_default_creds_(false), + orig_url_sec_mgr_(net::URLSecurityManager::Create(NULL, NULL)) {} bool ExplicitURLSecurityManager::CanUseDefaultCredentials(const GURL& auth_origin) const { - return allow_default_creds_; + if (allow_default_creds_) { + return true; + } + + return orig_url_sec_mgr_->CanUseDefaultCredentials(auth_origin); } bool ExplicitURLSecurityManager::CanDelegate(const GURL& auth_origin) const { - return false; + return orig_url_sec_mgr_->CanDelegate(auth_origin); } std::string URLRequestContextGetter::Delegate::GetUserAgent() { diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index da2091fb67..f1ed5da9d6 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -41,6 +41,7 @@ public: private: bool allow_default_creds_; + scoped_ptr orig_url_sec_mgr_; DISALLOW_COPY_AND_ASSIGN(ExplicitURLSecurityManager); };