From 11221979e55796403f27d2a15fe65d510d666087 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 30 Aug 2013 12:51:15 +0800 Subject: [PATCH] Disable overriding built-in protocols with protocol.registerProtocol. --- browser/api/atom_api_protocol.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/api/atom_api_protocol.cc b/browser/api/atom_api_protocol.cc index 5094c98e7bd7..abeac812b559 100644 --- a/browser/api/atom_api_protocol.cc +++ b/browser/api/atom_api_protocol.cc @@ -291,7 +291,7 @@ class AdapterProtocolHandler // static v8::Handle Protocol::RegisterProtocol(const v8::Arguments& args) { std::string scheme(*v8::String::Utf8Value(args[0])); - if (g_handlers.find(scheme) != g_handlers.end()) + if (net::URLRequest::IsHandledProtocol(scheme)) return node::ThrowError("The scheme is already registered"); // Store the handler in a map.