From 3f3613d27cbc810537e73222d579cfab85dce751 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Fri, 16 Sep 2005 16:01:24 +0000 Subject: [PATCH] Make unknown about: URIs throw the right error instead of silently doing nothing. Bug 87513, r=biesi, sr=darin --- netwerk/protocol/about/src/nsAboutProtocolHandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp index 7263e9f654c7..02e4a7e268f9 100644 --- a/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp +++ b/netwerk/protocol/about/src/nsAboutProtocolHandler.cpp @@ -47,6 +47,7 @@ #include "nsReadableUtils.h" #include "nsNetCID.h" #include "nsAboutProtocolUtils.h" +#include "nsNetError.h" static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID); @@ -152,6 +153,12 @@ nsAboutProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result) // mumble... + if (rv == NS_ERROR_FACTORY_NOT_REGISTERED) { + // This looks like an about: we don't know about. Convert + // this to an invalid URI error. + rv = NS_ERROR_MALFORMED_URI; + } + return rv; }