From a464f991e25309e0200eebb6ab3aa2da2ffa1d85 Mon Sep 17 00:00:00 2001 From: Alexander Moisseev Date: Wed, 15 Aug 2018 14:58:33 +0300 Subject: [PATCH] [Minor] Use Ajax "headers" parameter to set custom headers --- interface/js/app/rspamd.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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; -- 2.39.5