From 7108cc5f2b1408299e711d76d7a555b09518b8de Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Jun 2016 15:49:26 +0900 Subject: [PATCH] Mark standard scheme as safe scheme --- atom/browser/api/atom_api_protocol.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/atom/browser/api/atom_api_protocol.cc b/atom/browser/api/atom_api_protocol.cc index f420e52b3e9d..de4de9de59d9 100644 --- a/atom/browser/api/atom_api_protocol.cc +++ b/atom/browser/api/atom_api_protocol.cc @@ -17,6 +17,7 @@ #include "atom/common/options_switches.h" #include "base/command_line.h" #include "base/strings/string_util.h" +#include "content/public/browser/child_process_security_policy.h" #include "native_mate/dictionary.h" #include "url/url_util.h" @@ -161,8 +162,11 @@ namespace { void RegisterStandardSchemes( const std::vector& schemes) { - for (const auto& scheme : schemes) + auto policy = content::ChildProcessSecurityPolicy::GetInstance(); + for (const auto& scheme : schemes) { url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITHOUT_PORT); + policy->RegisterWebSafeScheme(scheme); + } auto command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitchASCII(atom::switches::kStandardSchemes,