From 1dbd41a746a380f878a11dec18a5cf5f7a67d2cd Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Thu, 6 Mar 2014 14:16:00 +0000 Subject: [PATCH] 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. --- Objective-J/CFHTTPRequest.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Objective-J/CFHTTPRequest.js b/Objective-J/CFHTTPRequest.js index 2b2d29c73..2084ca0a6 100644 --- a/Objective-J/CFHTTPRequest.js +++ b/Objective-J/CFHTTPRequest.js @@ -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());