couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1135353 - /couchdb/branches/1.0.x/share/www/script/jquery.couch.js
Date Tue, 14 Jun 2011 00:43:58 GMT
Author: davisp
Date: Tue Jun 14 00:43:57 2011
New Revision: 1135353

URL: http://svn.apache.org/viewvc?rev=1135353&view=rev
Log:
COUCHDB-1156 - Send Accept header to avoid HTML response.

Hand crafted backport of 1126411 from 1.1.x where rnewson
doesn't mention the revision from trunk.


Modified:
    couchdb/branches/1.0.x/share/www/script/jquery.couch.js

Modified: couchdb/branches/1.0.x/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/share/www/script/jquery.couch.js?rev=1135353&r1=1135352&r2=1135353&view=diff
==============================================================================
--- couchdb/branches/1.0.x/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/branches/1.0.x/share/www/script/jquery.couch.js [utf-8] Tue Jun 14 00:43:57 2011
@@ -615,8 +615,14 @@
   };
 
   function ajax(obj, options, errorMessage, ajaxOptions) {
+
+    var defaultAjaxOptions = {
+      contentType: "application/json",
+      headers: {"Accept": "application/json"}
+    };
+
     options = $.extend({successStatus: 200}, options);
-    ajaxOptions = $.extend({contentType: "application/json"}, ajaxOptions);
+    ajaxOptions = $.extend(defaultAjaxOptions, ajaxOptions);
     errorMessage = errorMessage || "Unknown error";
     $.ajax($.extend($.extend({
       type: "GET", dataType: "json", cache : !$.browser.msie,



Mime
View raw message