]> khamidou — GitHub mirrors - electron.git/commitdiff
Disable overriding built-in protocols with protocol.registerProtocol.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 30 Aug 2013 04:51:15 +0000 (12:51 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 30 Aug 2013 04:51:15 +0000 (12:51 +0800)
browser/api/atom_api_protocol.cc

index 5094c98e7bd79d83a81d7887a1929fd32a34f496..abeac812b5595e62a42f31337a9f6df6dc3c2199 100644 (file)
@@ -291,7 +291,7 @@ class AdapterProtocolHandler
 // static
 v8::Handle<v8::Value> 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.