Fixed: error in Internet Explorer if Info.plist was served with wrong content type.

Without this fix, in Internet Explorer the plist parser would only receive an empty XML document for the main Info.plist (and any other such loaded documents) if the server did not provide the content type "text/xml".

This fix parses the XML correctly even if there is no such content type.

Fixes #2051.
This commit is contained in:
Alexander Ljungberg
2014-03-06 14:16:00 +00:00
parent 8c43f4f628
commit 1dbd41a746
+4 -1
View File
@@ -172,7 +172,10 @@ CFHTTPRequest.prototype.responseXML = function()
{
var responseXML = this._nativeRequest.responseXML;
if (responseXML && (NativeRequest === window.XMLHttpRequest))
// Internet Explorer will return a non-null but empty request.responseXML if the response
// content type wasn't "text/html", so also check that responseXML.documentRoot is set.
// Otherwise fall back to regular parsing.
if (responseXML && (NativeRequest === window.XMLHttpRequest) && responseXML.documentRoot)
return responseXML;
return parseXML(this.responseText());