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

Unified Diff: chromeos/network/onc/onc_utils.cc

Issue 2619363004: RELAND: ONC: Fix handling of invalid proxy scheme. (Closed)
Patch Set: Fix test Created 3 years, 11 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 | « chromeos/network/DEPS ('k') | chromeos/network/onc/onc_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_utils.cc
diff --git a/chromeos/network/onc/onc_utils.cc b/chromeos/network/onc/onc_utils.cc
index a696ca5984855e530b1cfc9653571f5d1762193e..4f956c4167bcdb05d68e844f09616f40cd46418e 100644
--- a/chromeos/network/onc/onc_utils.cc
+++ b/chromeos/network/onc/onc_utils.cc
@@ -36,6 +36,7 @@
#include "components/prefs/pref_service.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/signin/core/account_id/account_id.h"
+#include "components/url_formatter/url_fixer.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "crypto/encryptor.h"
@@ -930,9 +931,9 @@ std::unique_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig(
std::string pac_url;
onc_proxy_settings.GetStringWithoutPathExpansion(::onc::proxy::kPAC,
&pac_url);
- GURL url(pac_url);
- DCHECK(url.is_valid()) << "Invalid URL in ProxySettings.PAC";
- proxy_dict.reset(ProxyConfigDictionary::CreatePacScript(url.spec(), false));
+ GURL url(url_formatter::FixupURL(pac_url, std::string()));
+ proxy_dict.reset(ProxyConfigDictionary::CreatePacScript(
+ url.is_valid() ? url.spec() : std::string(), false));
} else if (type == ::onc::proxy::kManual) {
const base::DictionaryValue* manual_dict = nullptr;
onc_proxy_settings.GetDictionaryWithoutPathExpansion(::onc::proxy::kManual,
« no previous file with comments | « chromeos/network/DEPS ('k') | chromeos/network/onc/onc_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698