1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-21 01:49:22 +02:00

Convert AJAX to POST request

This AJAX request sends form data in $_GET request query. This is problematic and unreliable when validating superrrr loooooong conditions, especially in environments that use reverse-proxy.

Been having this problem and this PR solves it. :)
This commit is contained in:
Phoenix Eve Aspacio 2024-12-11 10:06:10 +08:00 committed by GitHub
parent f065842402
commit d09e4ff020
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -179,9 +179,8 @@ $(document).ready(function() {
// Get script_data textarea content from form the button was clicked in // Get script_data textarea content from form the button was clicked in
var script = $('textarea[name="script_data"]', $(this).parents('form:first')).val(); var script = $('textarea[name="script_data"]', $(this).parents('form:first')).val();
$.ajax({ $.ajax({
dataType: 'json',
url: "/inc/ajax/sieve_validation.php", url: "/inc/ajax/sieve_validation.php",
type: "get", type: "post",
data: { script: script }, data: { script: script },
complete: function(data) { complete: function(data) {
var response = (data.responseText); var response = (data.responseText);