Add error messages for failed origin checks. Bug 292724, r=smaug+doronr, a=mkaply, NPOTB

git-svn-id: svn://10.0.0.236/trunk@173031 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
allan%beaufour.dk
2005-05-04 08:31:56 +00:00
parent 8695afc4e4
commit 6b796eec02
4 changed files with 31 additions and 12 deletions

View File

@@ -183,8 +183,13 @@ nsXFormsInstanceElement::OnChannelRedirect(nsIChannel *OldChannel,
mElement->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
NS_ENSURE_STATE(doc);
return nsXFormsUtils::CheckSameOrigin(doc->GetDocumentURI(), newURI) ?
NS_OK : NS_ERROR_ABORT;
if (!nsXFormsUtils::CheckSameOrigin(doc->GetDocumentURI(), newURI)) {
nsXFormsUtils::ReportError(NS_LITERAL_STRING("instanceLoadOrigin"), domDoc);
return NS_ERROR_ABORT;
}
return NS_OK;
}
// nsIStreamListener
@@ -401,6 +406,9 @@ nsXFormsInstanceElement::LoadExternalInstance(const nsAString &aSrc)
rv = docChannel->AsyncOpen(this, nsnull);
}
}
} else {
nsXFormsUtils::ReportError(NS_LITERAL_STRING("instanceLoadOrigin"),
domDoc);
}
}
}