diff --git a/content/xml/document/src/nsXMLDocument.cpp b/content/xml/document/src/nsXMLDocument.cpp index 673c98c67fe1..4a5daf62b3e9 100644 --- a/content/xml/document/src/nsXMLDocument.cpp +++ b/content/xml/document/src/nsXMLDocument.cpp @@ -254,29 +254,16 @@ nsXMLDocument::OnChannelRedirect(nsIChannel *aOldChannel, { NS_PRECONDITION(aNewChannel, "Redirecting to null channel?"); - nsCOMPtr newLocation; - nsresult rv = aNewChannel->GetURI(getter_AddRefs(newLocation)); // The redirected URI - if (NS_FAILED(rv)) - return rv; - - nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager(); - nsCOMPtr oldURI; - rv = aOldChannel->GetURI(getter_AddRefs(oldURI)); + nsresult rv = aOldChannel->GetURI(getter_AddRefs(oldURI)); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr newURI; rv = aNewChannel->GetURI(getter_AddRefs(newURI)); NS_ENSURE_SUCCESS(rv, rv); - rv = nsContentUtils::GetSecurityManager()-> + return nsContentUtils::GetSecurityManager()-> CheckSameOriginURI(oldURI, newURI, PR_TRUE); - - if (NS_FAILED(rv)) { - return rv; - } - - return NS_OK; } NS_IMETHODIMP