Bug 1348278 - Limit speculative connections to http[s] only. r=mcmanus

Some protocol handlers don't handle speculative connections too well
(they crash). So, we limit to the most useful protocols. This patch
brought to you by
https://bugzilla.mozilla.org/show_bug.cgi?id=1348278#c21

MozReview-Commit-ID: 8dWGdVtalIS

--HG--
extra : rebase_source : 9ba674282e40d8313fdb8fbd2f1b9ae7567d299d
This commit is contained in:
Nicholas Hurley 2017-04-28 11:37:24 -07:00
Родитель 9f4e3916ce
Коммит 7440d1d042
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1794,6 +1794,13 @@ nsIOService::SpeculativeConnectInternal(nsIURI *aURI,
nsIInterfaceRequestor *aCallbacks,
bool aAnonymous)
{
bool isHTTP, isHTTPS;
if (!(NS_SUCCEEDED(aURI->SchemeIs("http", &isHTTP)) && isHTTP) &&
!(NS_SUCCEEDED(aURI->SchemeIs("https", &isHTTPS)) && isHTTPS)) {
// We don't speculatively connect to non-HTTP[S] URIs.
return NS_OK;
}
if (IsNeckoChild()) {
ipc::URIParams params;
SerializeURI(aURI, params);