don't allow extract option to break jsonp
This commit is contained in:
parent
2177fbd446
commit
0870839e90
1 changed files with 1 additions and 1 deletions
|
|
@ -1113,7 +1113,7 @@ var m = (function app(window, undefined) {
|
|||
var isJSONP = xhrOptions.dataType && xhrOptions.dataType.toLowerCase() === "jsonp";
|
||||
var serialize = xhrOptions.serialize = isJSONP ? identity : xhrOptions.serialize || JSON.stringify;
|
||||
var deserialize = xhrOptions.deserialize = isJSONP ? identity : xhrOptions.deserialize || JSON.parse;
|
||||
var extract = xhrOptions.extract || function(xhr) {
|
||||
var extract = isJSONP ? function(jsonp) {return jsonp.responseText} : xhrOptions.extract || function(xhr) {
|
||||
return xhr.responseText.length === 0 && deserialize === JSON.parse ? null : xhr.responseText
|
||||
};
|
||||
xhrOptions.method = (xhrOptions.method || 'GET').toUpperCase();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue