Index: Source/core/xml/XMLHttpRequest.cpp |
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp |
index c043707688049ee47e6c2b286431a0b8c03a6bc4..1a7e5435f1b653355571929f6f154c736b66081c 100644 |
--- a/Source/core/xml/XMLHttpRequest.cpp |
+++ b/Source/core/xml/XMLHttpRequest.cpp |
@@ -242,7 +242,8 @@ Document* XMLHttpRequest::responseXML(ExceptionState& exceptionState) |
return 0; |
if (!m_createdDocument) { |
- bool isHTML = equalIgnoringCase(responseMIMEType(), "text/html"); |
+ AtomicString mimeType = responseMIMEType(); |
+ bool isHTML = equalIgnoringCase(mimeType, "text/html"); |
// The W3C spec requires the final MIME type to be some valid XML type, or text/html. |
// If it is text/html, then the responseType of "document" must have been supplied explicitly. |
@@ -260,6 +261,7 @@ Document* XMLHttpRequest::responseXML(ExceptionState& exceptionState) |
m_responseDocument->setContent(m_responseText.flattenToString()); |
m_responseDocument->setSecurityOrigin(securityOrigin()); |
m_responseDocument->setContextFeatures(document()->contextFeatures()); |
+ m_responseDocument->setMimeType(mimeType); |
if (!m_responseDocument->wellFormed()) |
m_responseDocument = nullptr; |
} |