Bug 783047 - Use HTTPS to download SafeBrowsing update chunks. r=mmc,dcamp

This commit is contained in:
Gian-Carlo Pascutto 2014-01-16 09:27:58 +01:00
parent dfb6145dce
commit 4b0ab86fdc

View File

@ -250,10 +250,14 @@ nsUrlClassifierStreamUpdater::UpdateUrlRequested(const nsACString &aUrl,
StringBeginsWith(aUrl, NS_LITERAL_CSTRING("file:"))) {
update->mUrl = aUrl;
} else {
// This must be fixed when bug 783047 is fixed. However, for unittesting
// update urls to localhost should use http, not https (otherwise the
// connection will fail silently, since there will be no cert available).
update->mUrl = NS_LITERAL_CSTRING("http://") + aUrl;
// For unittesting update urls to localhost should use http, not https
// (otherwise the connection will fail silently, since there will be no
// cert available).
if (!StringBeginsWith(aUrl, NS_LITERAL_CSTRING("localhost"))) {
update->mUrl = NS_LITERAL_CSTRING("https://") + aUrl;
} else {
update->mUrl = NS_LITERAL_CSTRING("http://") + aUrl;
}
}
update->mTable = aTable;