зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
75da430444
Коммит
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче