Skip to content

Commit

Permalink
COUCHDB-1156 - send Accept header so Futon doesn't display HTML where…
Browse files Browse the repository at this point in the history
… it expects JSON (Thanks Dale Harvey for patch)

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1101786 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
rnewson committed May 11, 2011
1 parent 479f515 commit e92b098
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion share/www/script/jquery.couch.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,14 @@
* @private
*/
function ajax(obj, options, errorMessage, ajaxOptions) {

var defaultAjaxOpts = {
contentType: "application/json",
headers:{"Accept": "application/json"}
};

options = $.extend({successStatus: 200}, options);
ajaxOptions = $.extend({contentType: "application/json"}, ajaxOptions);
ajaxOptions = $.extend(defaultAjaxOpts, ajaxOptions);
errorMessage = errorMessage || "Unknown error";
$.ajax($.extend($.extend({
type: "GET", dataType: "json", cache : !$.browser.msie,
Expand Down

0 comments on commit e92b098

Please sign in to comment.