]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Make web interface not send password in query strings (#585) 594/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 15 Apr 2016 17:09:30 +0000 (19:09 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 15 Apr 2016 17:14:19 +0000 (19:14 +0200)
interface/js/rspamd.js

index 3d6484cd8243091947384b71da751781d61ce8f9..2fcc6bfc36cb7d139d04754445d9b81dffd1082a 100644 (file)
@@ -78,8 +78,8 @@
                 dataType: 'json',
                 type: 'GET',
                 url: 'auth',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 success: function (data) {
                     if (data.auth === 'failed') {
@@ -94,8 +94,8 @@
                 dataType: 'json',
                 type: 'GET',
                 url: 'auth',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 success: function (data) {
                     saveCredentials(data, password);
             $.ajax({
                 dataType: 'json',
                 url: 'maps',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 error: function () {
                     alertMessage('alert-modal alert-error', data.statusText);
                 dataType: 'json',
                 type: 'GET',
                 url: 'pie',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 success: function (data) {
                     if (pie) {
             $.ajax({
                 dataType: 'json',
                 url: 'history',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 error: function () {
                     alertMessage('alert-error', 'Cannot receive history');
                 dataType: 'json',
                 type: 'GET',
                 url: 'symbols',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 success: function (data) {
                     $('#modalBody').empty();
                 dataType: 'json',
                 type: 'GET',
                 url: 'historyreset',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 success: function (data) {
                     getHistory();
                 dataType: 'json',
                 type: 'GET',
                 url: 'actions',
-                data: {
-                    password: getPassword()
+                beforeSend: function (xhr) {
+                    xhr.setRequestHeader('Password', getPassword());
                 },
                 success: function (data) {
                     // Order of sliders greylist -> probable spam -> spam
                     dataType: 'json',
                     type: 'GET',
                     url: 'auth',
-                    data: {
-                        password: password
+                    beforeSend: function (xhr) {
+                        xhr.setRequestHeader('Password', password);
                     },
                     success: function (data) {
                         if (data.auth === 'failed') {