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 5094c98..abeac81 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.