Browse Source

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.
Mohamad Safadieh 4 years ago
parent
commit
8dff74dd1b
2 changed files with 2 additions and 1 deletions
  1. 1 1
      searx/preferences.py
  2. 1 0
      searx/settings.yml

+ 1 - 1
searx/preferences.py

@@ -348,7 +348,7 @@ class Preferences(object):
                 }
                 }
             ),
             ),
             'method': EnumStringSetting(
             'method': EnumStringSetting(
-                'POST',
+                settings['server'].get('method', 'POST'),
                 choices=('GET', 'POST')
                 choices=('GET', 'POST')
             ),
             ),
             'safesearch': MapSetting(
             'safesearch': MapSetting(

+ 1 - 0
searx/settings.yml

@@ -16,6 +16,7 @@ server:
     base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/"
     base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/"
     image_proxy : False # Proxying image results through searx
     image_proxy : False # Proxying image results through searx
     http_protocol_version : "1.0"  # 1.0 and 1.1 are supported
     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:
 ui:
     static_path : "" # Custom static path - leave it blank if you didn't change
     static_path : "" # Custom static path - leave it blank if you didn't change