diff --git a/public/src/es.js b/public/src/es.js index 524afd0c..a5f9ec3d 100644 --- a/public/src/es.js +++ b/public/src/es.js @@ -31,9 +31,20 @@ module.exports.send = function (method, path, data, server, disable_auth_alert) // delayed loading for circular references var settings = require("./settings"); + let contentType; + if (data) { + try { + JSON.parse(data); + contentType = 'application/json'; + } catch (e) { + contentType = 'text/plain'; + } + } + var options = { url: '../api/sense/proxy?uri=' + encodeURIComponent(path), data: method == "GET" ? null : data, + contentType, cache: false, crossDomain: true, type: method,