Browse Source

fix: set enable_negotiate_port to false in allowNTLMCredentialsForDomains (#21580)

* fix: set enable_negotiate_port to false in allowNTLMCredentialsForDomains

* read commandline switch

Co-authored-by: Jeremy Apthorp <[email protected]>
trop[bot] 5 years ago
parent
commit
7e8c1108e0
1 changed files with 4 additions and 0 deletions
  1. 4 0
      shell/browser/api/atom_api_session.cc

+ 4 - 0
shell/browser/api/atom_api_session.cc

@@ -11,6 +11,7 @@
 #include <utility>
 #include <vector>
 
+#include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/guid.h"
 #include "base/strings/string_number_conversions.h"
@@ -512,6 +513,9 @@ void Session::AllowNTLMCredentialsForDomains(const std::string& domains) {
   network::mojom::HttpAuthDynamicParamsPtr auth_dynamic_params =
       network::mojom::HttpAuthDynamicParams::New();
   auth_dynamic_params->server_allowlist = domains;
+  auth_dynamic_params->enable_negotiate_port =
+      base::CommandLine::ForCurrentProcess()->HasSwitch(
+          electron::switches::kEnableAuthNegotiatePort);
   content::GetNetworkService()->ConfigureHttpAuthPrefs(
       std::move(auth_dynamic_params));
 }