зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1447341 - don't try to get a protocol handler for empty schemes, r=valentin
MozReview-Commit-ID: 3wJBC9TQsoV --HG-- extra : rebase_source : d6581efc9c2cb75c51837c310a6f09cc88e14e64
This commit is contained in:
Родитель
82f83be436
Коммит
1dbd3f74c6
|
@ -288,8 +288,12 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
|
|||
// really know about.
|
||||
nsCOMPtr<nsIProtocolHandler> ourHandler, extHandler;
|
||||
|
||||
ioService->GetProtocolHandler(scheme.get(), getter_AddRefs(ourHandler));
|
||||
extHandler = do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "default");
|
||||
if (!scheme.IsEmpty()) {
|
||||
ioService->GetProtocolHandler(scheme.get(), getter_AddRefs(ourHandler));
|
||||
} else {
|
||||
ourHandler = extHandler;
|
||||
}
|
||||
|
||||
if (ourHandler != extHandler || !PossiblyHostPortUrl(uriString)) {
|
||||
// Just try to create an URL out of it
|
||||
|
|
|
@ -542,7 +542,7 @@ nsIOService::GetProtocolHandler(const char* scheme, nsIProtocolHandler* *result)
|
|||
if (NS_SUCCEEDED(rv))
|
||||
return rv;
|
||||
|
||||
if (!UsesExternalProtocolHandler(scheme)) {
|
||||
if (scheme[0] != '\0' && !UsesExternalProtocolHandler(scheme)) {
|
||||
nsAutoCString contractID(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX);
|
||||
contractID += scheme;
|
||||
ToLowerCase(contractID);
|
||||
|
|
Загрузка…
Ссылка в новой задаче