From: Alexander Moisseev Date: Wed, 15 Aug 2018 11:58:33 +0000 (+0300) Subject: [Minor] Use Ajax "headers" parameter X-Git-Tag: 1.8.0~255^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a464f991e25309e0200eebb6ab3aa2da2ffa1d85;p=rspamd.git [Minor] Use Ajax "headers" parameter to set custom headers --- diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 06d9a46f9..32a1ad297 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -195,15 +195,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config, var req_params = { jsonp: false, data: o.data, - beforeSend: function (xhr) { - xhr.setRequestHeader("Password", getPassword()); - - if (o.headers) { - $.each(o.headers, function (hname, hvalue) { - xhr.setRequestHeader(hname, hvalue); - }); - } - }, + headers: $.extend({Password: getPassword()}, o.headers), url: neighbours_status[ind].url + req_url, success: function (json) { neighbours_status[ind].checked = true;