Skip to content

Commit

Permalink
Merge branch 'kibana-4.x' of github.com:elastic/sense into kibana-4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Aug 9, 2016
2 parents f408274 + 69e4be0 commit 63f5d11
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions public/src/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 63f5d11

Please sign in to comment.