]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix bloody jsonp
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 4 Oct 2016 16:27:31 +0000 (17:27 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 4 Oct 2016 16:27:31 +0000 (17:27 +0100)
interface/js/rspamd.js

index cfbf59da7f24138e9fc28480b8e83a0fb038f895..df6b6d789b1e30bdeae78b384275d3bc26b6d65f 100644 (file)
                 dataType: 'json',
                 type: 'GET',
                 url: 'auth',
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
             $.ajax({
                 dataType: 'json',
                 url: 'maps',
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
                 $.ajax({
                     dataType: 'text',
                     url: 'getmap',
+                    jsonp: false,
                     beforeSend: function (xhr) {
                         xhr.setRequestHeader('Password', getPassword());
                         xhr.setRequestHeader('Map', item.map);
                 dataType: 'json',
                 type: 'GET',
                 url: 'pie',
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
                 dataType: 'json',
                 type: 'GET',
                 url: 'graph',
+                jsonp: false,
                 data: {"type": type},
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
             $.ajax({
                 dataType: 'json',
                 url: 'history',
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
                 dataType: 'json',
                 type: 'GET',
                 url: 'symbols',
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
             $.ajax({
                 dataType: 'json',
                 type: 'GET',
+                jsonp: false,
                 url: 'historyreset',
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 dataType: 'json',
                 type: 'POST',
                 url: url,
+                processData: false,
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                     $.each(headers, function (name, value) {
                 dataType: 'json',
                 type: 'POST',
                 url: url,
+                processData: false,
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
                         alertMessage('alert-error', 'Cannot scan data');
                     }
                 },
+                error: function (jqXHR, textStatus, errorThrown) {
+                    alertMessage('alert-error', 'Cannot upload data: ' +
+                        textStatus + ", " + errorThrown);
+                },
                 statusCode: {
                     404: function () {
                         alertMessage('alert-error', 'Cannot upload data, no server found');
                 dataType: 'json',
                 type: 'GET',
                 url: 'actions',
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
                 dataType: 'json',
                 type: 'POST',
                 url: url,
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
                 data: data,
                 dataType: 'text',
                 type: 'POST',
+                jsonp: false,
                 url: action,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 dataType: 'json',
                 type: 'POST',
                 url: url,
+                jsonp: false,
                 beforeSend: function (xhr) {
                     xhr.setRequestHeader('Password', getPassword());
                 },
             $.ajax({
                 type: 'GET',
                 url: 'stat',
+                jsonp: false,
                 success: function () {
                     saveCredentials({}, 'nopassword');
                     $(dialog).hide();
                 document.getElementById('connectPassword').value = '';
                 $.ajax({
                     global: false,
+                    jsonp: false,
                     dataType: 'json',
                     type: 'GET',
                     url: 'auth',