summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvojkovic <git@vojk.au>2026-08-02 13:29:07 +0000
committerBrock Vojkovic <brock@vojk.au>2026-08-03 19:51:02 +0800
commitd81810d2a7b22825ec541bc3ecd0215fcc55b25d (patch)
tree02a45d34438ea0660396cf6ed8a9a57c9e4dac29
parent8892414dc38dd57728b7f62f33152ea80e3b305f (diff)
[fix] autocomplete: drop POST method
-rw-r--r--client/simple/src/js/main/autocomplete.ts8
-rw-r--r--searx/templates/simple/opensearch.xml4
-rwxr-xr-xsearx/webapp.py2
3 files changed, 4 insertions, 10 deletions
diff --git a/client/simple/src/js/main/autocomplete.ts b/client/simple/src/js/main/autocomplete.ts
index aea67c75d..15eb8304b 100644
--- a/client/simple/src/js/main/autocomplete.ts
+++ b/client/simple/src/js/main/autocomplete.ts
@@ -5,13 +5,7 @@ import { assertElement } from "../util/assertElement.ts";
const fetchResults = async (qInput: HTMLInputElement, query: string): Promise<void> => {
try {
- let res: Response;
-
- if (settings.method === "GET") {
- res = await http("GET", `./autocompleter?q=${query}`);
- } else {
- res = await http("POST", "./autocompleter", { body: new URLSearchParams({ q: query }) });
- }
+ const res = await http("GET", `./autocompleter?q=${query}`);
const results = await res.json();
diff --git a/searx/templates/simple/opensearch.xml b/searx/templates/simple/opensearch.xml
index 5176c012c..bdca24b4b 100644
--- a/searx/templates/simple/opensearch.xml
+++ b/searx/templates/simple/opensearch.xml
@@ -13,9 +13,9 @@
</Url>
{% endif %}
{% if autocomplete %}
- <Url rel="suggestions" type="application/x-suggestions+json" method="{{ opensearch_method }}" template="{{ url_for('autocompleter', _external=True) }}?q={searchTerms}"/>
+ <Url rel="suggestions" type="application/x-suggestions+json" method="GET" template="{{ url_for('autocompleter', _external=True) }}?q={searchTerms}"/>
{% endif %}
- <Url rel="self" type="application/opensearchdescription+xml" method="{{ opensearch_method }}" template="{{ url_for('opensearch', _external=True) }}" />
+ <Url rel="self" type="application/opensearchdescription+xml" template="{{ url_for('opensearch', _external=True) }}" />
<Query role="example" searchTerms="SearXNG" />
<moz:SearchForm>{{ url_for('search', _external=True) }}</moz:SearchForm>
</OpenSearchDescription>
diff --git a/searx/webapp.py b/searx/webapp.py
index 18df14f58..ff2f496b5 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -803,7 +803,7 @@ def info(pagename, locale):
)
-@app.route('/autocompleter', methods=['GET', 'POST'])
+@app.route('/autocompleter', methods=['GET'])
def autocompleter():
"""Return autocompleter results"""