How to fix 'Failed to load resources: the server responded with a status of 499 ()' error XMLHttpRequest/jQuery

5.1k Views Asked by At

I have HTML webpage that uses JQuery (3.1.0) to post data via XMLHttpRequest from a form to the server (PHP) to perform mysql search and send back the results to be appended in a table, the issue: that after conducting 3 or 4 searches on same page without reloading; Kaspersky Internet Security (which is installed on my PC) blocks the connections and fires error 499 () as follows:

Failed to load resources: the server responded with a status of 499 ()

I have searched for a reason and found that Kaspersky blocks this under 'Heuristic analysis' thinking that this might be unknown virus. Some posts on Kaspersky forum suggest to turn off some features in Kaspersky to let it unblock such connection. However, this will not solve the problem, as I don't expect users to do the same, who will face the same problem, so I'm looking for a general solution.

The code that I use for posting data is as follows:

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
               var jsonData = JSON.parse(this.response);
               $('#result_table').append(jsonData.received_data);
    }
};
xhttp.open("POST", "search.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(search_phrase + "&k=" + keyword");   

I'm looking for a way that let Kaspersky understand that this connection is trusted.

1

There are 1 best solutions below

0
On

I have visited Kaspersky virusdesk webpage and submitted the page for scanning (the PHP file) and after that, the website started to work normally.

I think this solves the issue.