diff options
| -rw-r--r-- | client/simple/src/js/main/autocomplete.ts | 8 | ||||
| -rw-r--r-- | searx/templates/simple/opensearch.xml | 4 | ||||
| -rwxr-xr-x | searx/webapp.py | 2 |
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""" |
