mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 22:07:41 +00:00
Don't try to parse the response on necko-level errors (dns failures, timeouts,
etc). Bug 268472, r+sr=jst
This commit is contained in:
parent
75da430444
commit
3b1310cdc8
@ -1209,7 +1209,7 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
||||
nsCAutoString type;
|
||||
channel->GetContentType(type);
|
||||
|
||||
if (type.Find("xml") == -1) {
|
||||
if (type.Find("xml") == kNotFound) {
|
||||
mState &= ~XML_HTTP_REQUEST_PARSEBODY;
|
||||
}
|
||||
} else {
|
||||
@ -1217,6 +1217,9 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
||||
request->GetStatus(&status);
|
||||
if (NS_SUCCEEDED(status)) {
|
||||
channel->SetContentType(mOverrideMimeType);
|
||||
} else {
|
||||
// The request failed, so we shouldn't be parsing anyway
|
||||
mState &= ~XML_HTTP_REQUEST_PARSEBODY;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user