mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Create a new URLSecurityManager that allows explicit settings
This commit is contained in:
@@ -84,6 +84,16 @@ const char kProxyPacUrl[] = "proxy-pac-url";
|
||||
|
||||
} // namespace
|
||||
|
||||
ExplicitURLSecurityManager::ExplicitURLSecurityManager() : allow_default_creds_(false) {}
|
||||
|
||||
bool ExplicitURLSecurityManager::CanUseDefaultCredentials(const GURL& auth_origin) const {
|
||||
return allow_default_creds_;
|
||||
}
|
||||
|
||||
bool ExplicitURLSecurityManager::CanDelegate(const GURL& auth_origin) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string URLRequestContextGetter::Delegate::GetUserAgent() {
|
||||
return base::EmptyString();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,21 @@ namespace brightray {
|
||||
class DevToolsNetworkController;
|
||||
class NetLog;
|
||||
|
||||
class ExplicitURLSecurityManager : public net::URLSecurityManager {
|
||||
public:
|
||||
ExplicitURLSecurityManager();
|
||||
|
||||
virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
|
||||
virtual bool CanDelegate(const GURL& auth_origin) const override;
|
||||
|
||||
void AllowNTLMCredentialsForAllDomains(bool should_allow) { allow_default_creds_ = should_allow; }
|
||||
|
||||
private:
|
||||
bool allow_default_creds_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ExplicitURLSecurityManager);
|
||||
};
|
||||
|
||||
class URLRequestContextGetter : public net::URLRequestContextGetter {
|
||||
public:
|
||||
class Delegate {
|
||||
|
||||
Reference in New Issue
Block a user