[Pkg-javascript-commits] [backbone] 89/211: Only set request content type for create/update

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.0
in repository backbone.

commit 83250a5a62ba5de7648ad2ee08ce379bad6b010d
Author: Jason Davies <jason at jasondavies.com>
Date:   Wed Mar 9 18:35:26 2011 +0000

    Only set request content type for create/update
---
 backbone.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backbone.js b/backbone.js
index 47e85ae..70d9a9e 100644
--- a/backbone.js
+++ b/backbone.js
@@ -971,7 +971,6 @@
     // Default JSON-request options.
     var params = _.extend({
       type:         type,
-      contentType:  'application/json',
       dataType:     'json',
       processData:  false
     }, options);
@@ -983,6 +982,7 @@
 
     // Ensure that we have the appropriate request data.
     if (!params.data && model && (method == 'create' || method == 'update')) {
+      params.contentType = 'application/json',
       params.data = JSON.stringify(model.toJSON());
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list