forked from jquery/jquery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make an attempt to parse the response body as XML if the user is expe…
…cting XML, even if the Content-Type says otherwise. Prior to this patch, if an XML document is sent with the wrong Content-Type (e.g. "text/html"), jQuery will return a parsererror, even if the response body is valid XML. This issue was discovered via a Rails bug in which cached content (in our case, an XML document) is returned with a Content-Type of "text/html" rather than the original Content-Type. See https://rails.lighthouseapp.com/projects/8994/tickets/1585-action-caching-sets-wrong-content-type-when-cache_path-is-a-string Ticket #5764 (http://dev.jquery.com/ticket/5764)
- Loading branch information
Brad Greenlee
committed
Jan 6, 2010
1 parent
ff3645e
commit 88937d5
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
header("Content-Type: text/html"); | ||
echo '<?xml version="1.0" encoding="UTF-8"?>'; | ||
?> | ||
<root> | ||
<nodes> | ||
<node>Peanut Butter</node> | ||
<node>Jelly</node> | ||
</nodes> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters