content-type can be undefined

This commit is contained in:
nightwing 2015-05-21 13:10:34 +04:00
parent ab562977b5
commit bdd23d065b

View File

@ -106,9 +106,8 @@ define(function(require, module, exports) {
};
var data = xhr.responseText;
if ((options.overrideMimeType || res.headers["content-type"])
.indexOf("application/json") === 0
) {
var contentType = options.overrideMimeType || res.headers["content-type"] || "";
if (contentType.indexOf("application/json") === 0) {
try {
data = JSON.parse(data);
} catch (e) {