diff options
Diffstat (limited to 'netwerk/protocol/about/nsAboutProtocolHandler.cpp')
-rw-r--r-- | netwerk/protocol/about/nsAboutProtocolHandler.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/netwerk/protocol/about/nsAboutProtocolHandler.cpp b/netwerk/protocol/about/nsAboutProtocolHandler.cpp index 5bbaa9010e..ab4d62f989 100644 --- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp +++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp @@ -21,6 +21,7 @@ #include "nsIChannel.h" #include "nsIScriptError.h" #include "nsIClassInfoImpl.h" +#include "DefaultURI.h" #include "mozilla/ipc/URIUtils.h" @@ -136,6 +137,16 @@ nsresult nsAboutProtocolHandler::CreateNewURI(const nsACString& aSpec, NS_ENSURE_SUCCESS(rv, rv); } + // use DefaultURI to check for validity when we have possible hostnames + // since nsSimpleURI doesn't know about hostnames + auto pos = aSpec.Find("about:/"); + if (pos != kNotFound) { + rv = NS_MutateURI(new mozilla::net::DefaultURI::Mutator()) + .SetSpec(aSpec) + .Finalize(url); + NS_ENSURE_SUCCESS(rv, rv); + } + url.swap(*aResult); return NS_OK; } |