Bug 292637 - nsSchemaLoader can only load http/https urls. r=biesi,sr=jst,a=mkaply
git-svn-id: svn://10.0.0.236/trunk@173038 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
36aee01960
commit
8a0bd8eab2
@ -143,13 +143,29 @@ LoadListener::HandleEvent(nsIDOMEvent *event)
|
||||
nsAutoString eventType;
|
||||
event->GetType(eventType);
|
||||
|
||||
if ((httpStatus / 100 == 2) && eventType.EqualsLiteral("load")) {
|
||||
PRBool succeeded = (httpStatus / 100 == 2);
|
||||
|
||||
// if we loaded fine, and not http/https, we assume success in loaded the file.
|
||||
if (!succeeded && eventType.EqualsLiteral("load")) {
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
mRequest->GetChannel(getter_AddRefs(channel));
|
||||
if (channel) {
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
|
||||
|
||||
// if qi to httpChannel fails, it isn't a http:// or https:// request
|
||||
if (!httpChannel) {
|
||||
succeeded = PR_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (succeeded && eventType.EqualsLiteral("load")) {
|
||||
nsCOMPtr<nsIDOMDocument> document;
|
||||
|
||||
|
||||
rv = mRequest->GetResponseXML(getter_AddRefs(document));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
|
||||
|
||||
if (document)
|
||||
document->GetDocumentElement(getter_AddRefs(element));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user