Skip to content

Commit

Permalink
Fixed: error in Internet Explorer if Info.plist was served with wrong…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
aljungberg committed Mar 6, 2014
1 parent 8c43f4f commit 1dbd41a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Objective-J/CFHTTPRequest.js
Expand Up @@ -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());
Expand Down

0 comments on commit 1dbd41a

Please sign in to comment.