author | Stone Shih <sshih@mozilla.com> |
Wed, 16 Mar 2016 14:02:34 +0800 | |
changeset 327224 | fd2df0fdbc401dc8d605eae9905e407bd08d4c84 |
parent 327223 | 752de758530e2912480f00874a0296aebf1657c6 |
child 327225 | 093561da226a8bfca530afdbb0eaab4c57c6eb58 |
push id | 6048 |
push user | kmoir@mozilla.com |
push date | Mon, 06 Jun 2016 19:02:08 +0000 |
treeherder | mozilla-beta@46d72a56c57d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | khuey |
bugs | 1255597 |
milestone | 48.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/base/nsXMLHttpRequest.cpp +++ b/dom/base/nsXMLHttpRequest.cpp @@ -1985,17 +1985,22 @@ nsXMLHttpRequest::OnStartRequest(nsIRequ if (!(mState & XML_HTTP_REQUEST_ASYNC)) { // We don't make cool new features available in the bad synchronous // mode. The synchronous mode is for legacy only. mWarnAboutSyncHtml = true; mState &= ~XML_HTTP_REQUEST_PARSEBODY; } else { mIsHtml = true; } - } else if (type.Find("xml") == kNotFound) { + } else if (!(type.EqualsLiteral("text/xml") || + type.EqualsLiteral("application/xml") || + type.RFind("+xml", true, -1, 4) != kNotFound)) { + // Follow https://xhr.spec.whatwg.org/ + // If final MIME type is not null, text/html, text/xml, application/xml, + // or does not end in +xml, return null. mState &= ~XML_HTTP_REQUEST_PARSEBODY; } } else { // The request failed, so we shouldn't be parsing anyway mState &= ~XML_HTTP_REQUEST_PARSEBODY; } if (mState & XML_HTTP_REQUEST_PARSEBODY) {