From 8dff74dd1b9f63b6e300991211582157b34ee328 Mon Sep 17 00:00:00 2001 From: Mohamad Safadieh Date: Sun, 9 Aug 2020 16:57:31 -0400 Subject: [PATCH] Make default query submission method configurable Sending queries through POST, while better for privacy, breaks functionality with certain extensions (e.g. Firefox containers). Since Firefox does not send cookies when requesting `/opensearch.xml`, users cannot easily switch to GET on the client side unless they make a custom search engine. This commit allows admins to modify the default method on their side so they can set it to GET if needed. --- searx/preferences.py | 2 +- searx/settings.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/searx/preferences.py b/searx/preferences.py index f70aee37a..34da1b7c6 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -348,7 +348,7 @@ class Preferences(object): } ), 'method': EnumStringSetting( - 'POST', + settings['server'].get('method', 'POST'), choices=('GET', 'POST') ), 'safesearch': MapSetting( diff --git a/searx/settings.yml b/searx/settings.yml index 63685be8b..68fd0ee6f 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -16,6 +16,7 @@ server: base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/" image_proxy : False # Proxying image results through searx http_protocol_version : "1.0" # 1.0 and 1.1 are supported + method: "POST" # POST queries are more secure as they don't show up in history but may cause problems when using Firefox containers ui: static_path : "" # Custom static path - leave it blank if you didn't change