From c23401e9fa3504e64ecf8dc5eae59e3f532d16fe Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Sat, 19 Sep 2020 10:13:05 +0200 Subject: [fix] simple theme: fix autocomplete AJAX requests send the X-Requested-With HTTP header, so searx.webapp.autocompleter returns the results with the expected data format. Related to #2127 Close #2203 --- searx/static/themes/simple/js/searx.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'searx/static/themes/simple/js/searx.js') diff --git a/searx/static/themes/simple/js/searx.js b/searx/static/themes/simple/js/searx.js index 3e9ad3e7f..8fb2471b0 100644 --- a/searx/static/themes/simple/js/searx.js +++ b/searx/static/themes/simple/js/searx.js @@ -1531,6 +1531,10 @@ module.exports = AutoComplete; Url: "./autocompleter", EmptyMessage: searx.no_item_found, HttpMethod: searx.method, + HttpHeaders: { + "Content-type": "application/x-www-form-urlencoded", + "X-Requested-With": "XMLHttpRequest" + }, MinChars: 4, Delay: 300, }, "#" + qinput_id); -- cgit v1.2.3