mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Merge pull request #469 from afeld/patch-1
processData should default to true
This commit is contained in:
@@ -1035,8 +1035,7 @@
|
||||
// Default JSON-request options.
|
||||
var params = _.extend({
|
||||
type: type,
|
||||
dataType: 'json',
|
||||
processData: false
|
||||
dataType: 'json'
|
||||
}, options);
|
||||
|
||||
// Ensure that we have a URL.
|
||||
@@ -1053,7 +1052,6 @@
|
||||
// For older servers, emulate JSON by encoding the request into an HTML-form.
|
||||
if (Backbone.emulateJSON) {
|
||||
params.contentType = 'application/x-www-form-urlencoded';
|
||||
params.processData = true;
|
||||
params.data = params.data ? {model : params.data} : {};
|
||||
}
|
||||
|
||||
@@ -1069,6 +1067,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Don't process data on a non-GET request.
|
||||
if (params.type !== 'GET') {
|
||||
params.processData = false;
|
||||
}
|
||||
|
||||
// Make the request.
|
||||
return $.ajax(params);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user