Bug 1148732 - When checking a document's scheme, check the innermost uri. r=dveditz, smaug

This commit is contained in:
Tanvi Vyas 2015-04-15 10:18:27 -07:00
parent 0c32cb5990
commit ac8b060203

View File

@ -565,7 +565,14 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
// Check the parent scheme. If it is not an HTTPS page then mixed content
// restrictions do not apply.
bool parentIsHttps;
nsresult rv = requestingLocation->SchemeIs("https", &parentIsHttps);
nsCOMPtr<nsIURI> innerURI = NS_GetInnermostURI(requestingLocation);
if (!innerURI) {
NS_ERROR("Can't get innerURI from requestingLocation");
*aDecision = REJECT_REQUEST;
return NS_OK;
}
nsresult rv = innerURI->SchemeIs("https", &parentIsHttps);
if (NS_FAILED(rv)) {
NS_ERROR("requestingLocation->SchemeIs failed");
*aDecision = REJECT_REQUEST;