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_src/searx_search.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'searx/static/themes/simple/js/searx_src') diff --git a/searx/static/themes/simple/js/searx_src/searx_search.js b/searx/static/themes/simple/js/searx_src/searx_search.js index 580d98d6a..7b652fa92 100644 --- a/searx/static/themes/simple/js/searx_src/searx_search.js +++ b/searx/static/themes/simple/js/searx_src/searx_search.js @@ -75,6 +75,10 @@ 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