SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[enh] add default http headers - closes #715
Adam Tauber063260d090d1
diff --git a/searx/settings.yml b/searx/settings.ymlindex 54352bbfc..5cab0a102 100644--- a/searx/settings.yml+++ b/searx/settings.yml@@ -17,6 +17,12 @@ server:image_proxy : False # Proxying image results through searxhttp_protocol_version : "1.0" # 1.0 and 1.1 are supportedmethod: "POST" # POST queries are more secure as they don't show up in history but may cause problems when using Firefox containers+ default_http_headers:+ X-Content-Type-Options : nosniff+ X-XSS-Protection : 1; mode=block+ X-Download-Options : noopen+ X-Robots-Tag : noindex, nofollow+ Referrer-Policy : no-referrerui:static_path : "" # Custom static path - leave it blank if you didn't changediff --git a/searx/webapp.py b/searx/webapp.pyindex 46d547d52..d68ae349a 100755--- a/searx/webapp.py+++ b/searx/webapp.py@@ -487,6 +487,16 @@ def pre_request():request.user_plugins.append(plugin)[email protected]_request+def add_default_headers(response):+ # set default http headers+ for header, value in settings['server'].get('default_http_headers', {}).items():+ if header in response.headers:+ continue+ response.headers[header] = value+ return response++@app.after_requestdef post_request(response):total_time = time() - request.start_time