зеркало из https://github.com/mozilla/pjs.git
Fix for bug 307049 (XMLHttpRequest seems to try to parse the empty (!) body of the response to an HTTP HEAD request). r=biesi, sr=bz.
This commit is contained in:
Родитель
119dbbf56b
Коммит
94823fcb4b
|
@ -1235,7 +1235,15 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
|||
nsresult status;
|
||||
request->GetStatus(&status);
|
||||
|
||||
if (NS_SUCCEEDED(status)) {
|
||||
PRBool parseBody = PR_TRUE;
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
|
||||
if (httpChannel) {
|
||||
nsCAutoString method;
|
||||
httpChannel->GetRequestMethod(method);
|
||||
parseBody = !method.EqualsLiteral("HEAD");
|
||||
}
|
||||
|
||||
if (parseBody && NS_SUCCEEDED(status)) {
|
||||
if (!mOverrideMimeType.IsEmpty()) {
|
||||
channel->SetContentType(mOverrideMimeType);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче