mirror of https://github.com/searxng/searxng.git
Compare commits
3 Commits
e1b70ad474
...
3c9d559834
Author | SHA1 | Date |
---|---|---|
Markus Heiser | 3c9d559834 | |
Markus Heiser | 10d3af84b8 | |
Markus Heiser | ca85d20204 |
|
@ -14,6 +14,7 @@
|
|||
limiter: false
|
||||
public_instance: false
|
||||
image_proxy: false
|
||||
method: "GET"
|
||||
default_http_headers:
|
||||
X-Content-Type-Options : nosniff
|
||||
X-Download-Options : noopen
|
||||
|
@ -50,8 +51,14 @@
|
|||
``image_proxy`` : ``$SEARXNG_IMAGE_PROXY``
|
||||
Allow your instance of SearXNG of being able to proxy images. Uses memory space.
|
||||
|
||||
``method`` : ``GET`` | ``POST``
|
||||
HTTP method. By defaults ``GET`` is used / The ``POST`` method has the
|
||||
advantage with some WEB browsers that the history is not easy to read, but
|
||||
there are also various disadvantages that sometimes severely restrict the ease
|
||||
of use for the user (e.g. back button to jump back to the previous search
|
||||
page and drag & drop of search term to new tabs do not work as expected).
|
||||
|
||||
.. _HTTP headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
|
||||
|
||||
``default_http_headers`` :
|
||||
Set additional HTTP headers, see `#755 <https://github.com/searx/searx/issues/715>`__
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ DuckDuckGo Lite
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
import re
|
||||
from urllib.parse import urlencode, quote_plus
|
||||
from urllib.parse import urlencode
|
||||
import json
|
||||
import babel
|
||||
import lxml.html
|
||||
|
@ -263,7 +263,7 @@ def request(query, params):
|
|||
|
||||
params['url'] = url
|
||||
params['method'] = 'POST'
|
||||
params['data']['q'] = quote_plus(query)
|
||||
params['data']['q'] = query
|
||||
|
||||
# The API is not documented, so we do some reverse engineering and emulate
|
||||
# what https://html.duckduckgo.com/html does when you press "next Page" link
|
||||
|
@ -381,7 +381,11 @@ def response(resp):
|
|||
zero_click_info_xpath = '//div[@id="zero_click_abstract"]'
|
||||
zero_click = extract_text(eval_xpath(doc, zero_click_info_xpath)).strip()
|
||||
|
||||
if zero_click and "Your IP address is" not in zero_click and "Your user agent:" not in zero_click:
|
||||
if zero_click and (
|
||||
"Your IP address is" not in zero_click
|
||||
and "Your user agent:" not in zero_click
|
||||
and "URL Decoded:" not in zero_click
|
||||
):
|
||||
current_query = resp.search_params["data"].get("q")
|
||||
|
||||
results.append(
|
||||
|
|
|
@ -98,7 +98,7 @@ server:
|
|||
http_protocol_version: "1.0"
|
||||
# POST queries are more secure as they don't show up in history but may cause
|
||||
# problems when using Firefox containers
|
||||
method: "POST"
|
||||
method: "GET"
|
||||
default_http_headers:
|
||||
X-Content-Type-Options: nosniff
|
||||
X-Download-Options: noopen
|
||||
|
@ -145,11 +145,11 @@ ui:
|
|||
# Lock arbitrary settings on the preferences page. To find the ID of the user
|
||||
# setting you want to lock, check the ID of the form on the page "preferences".
|
||||
#
|
||||
# preferences:
|
||||
# lock:
|
||||
preferences:
|
||||
lock:
|
||||
- method
|
||||
# - language
|
||||
# - autocomplete
|
||||
# - method
|
||||
# - query_in_title
|
||||
|
||||
# searx supports result proxification using an external service:
|
||||
|
|
Loading…
Reference in New Issue