Bug 861117 - report errors when URIs passed into nsISiteSecurityService::IsSecureURI are malformed. r=briansmith,keeler

This commit is contained in:
Sid Stamm 2014-01-24 14:37:51 -08:00
parent 98ee63ffd2
commit 44162c7454

View File

@ -272,12 +272,12 @@ nsHttpChannel::Connect()
rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HSTS, mURI, flags,
&isStsHost);
// if SSS fails, there's no reason to cancel the load, but it's
// worrisome.
NS_ASSERTION(NS_SUCCEEDED(rv),
"Something is wrong with SSS: IsSecureURI failed.");
// if the SSS check fails, it's likely because this load is on a
// malformed URI or something else in the setup is wrong, so any error
// should be reported.
NS_ENSURE_SUCCESS(rv, rv);
if (NS_SUCCEEDED(rv) && isStsHost) {
if (isStsHost) {
LOG(("nsHttpChannel::Connect() STS permissions found\n"));
return AsyncCall(&nsHttpChannel::HandleAsyncRedirectChannelToHttps);
}