summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/js/searx.js
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-09-19 10:13:05 +0200
committerAlexandre Flament <alex@al-f.net>2020-09-19 10:13:05 +0200
commitc23401e9fa3504e64ecf8dc5eae59e3f532d16fe (patch)
tree23ed62c8d2f3f263b4ff2995d0534b6225ef3395 /searx/static/themes/simple/js/searx.js
parentae07f4a211ecba0331bcab5903e3263c646f8bdb (diff)
downloadsearxng-c23401e9fa3504e64ecf8dc5eae59e3f532d16fe.tar.gz
searxng-c23401e9fa3504e64ecf8dc5eae59e3f532d16fe.zip
[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
Diffstat (limited to 'searx/static/themes/simple/js/searx.js')
-rw-r--r--searx/static/themes/simple/js/searx.js4
1 files changed, 4 insertions, 0 deletions
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);