summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoémi Ványi <kvch@users.noreply.github.com>2019-06-30 13:45:09 +0200
committerGitHub <noreply@github.com>2019-06-30 13:45:09 +0200
commit6c750528749afcfd878347df78ccd45aaf8afcd6 (patch)
tree6d345fd9d6537dc712d2d7b705e62af50e242332
parent06979fa0829697ed3b0b1946a2ef7b43f308e2c4 (diff)
parent4c768f9fe6e43936d3f06ad619a45fe07fa8bebf (diff)
downloadsearxng-6c750528749afcfd878347df78ccd45aaf8afcd6.tar.gz
searxng-6c750528749afcfd878347df78ccd45aaf8afcd6.zip
Merge branch 'master' into ne/improve-infinite-scroll
-rw-r--r--searx/__init__.py2
-rw-r--r--searx/webapp.py4
-rw-r--r--tests/unit/test_webapp.py6
3 files changed, 10 insertions, 2 deletions
diff --git a/searx/__init__.py b/searx/__init__.py
index 4d7b2a8d3..d32fe0066 100644
--- a/searx/__init__.py
+++ b/searx/__init__.py
@@ -91,3 +91,5 @@ logger.info('Initialisation done')
if 'SEARX_SECRET' in environ:
settings['server']['secret_key'] = environ['SEARX_SECRET']
+if 'SEARX_BIND_ADDRESS' in environ:
+ settings['server']['bind_address'] = environ['SEARX_BIND_ADDRESS']
diff --git a/searx/webapp.py b/searx/webapp.py
index 727259774..8290b6822 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -846,7 +846,7 @@ def clear_cookies():
@app.route('/config')
def config():
- return jsonify({'categories': categories.keys(),
+ return jsonify({'categories': list(categories.keys()),
'engines': [{'name': engine_name,
'categories': engine.categories,
'shortcut': engine.shortcut,
@@ -854,7 +854,7 @@ def config():
'paging': engine.paging,
'language_support': engine.language_support,
'supported_languages':
- engine.supported_languages.keys()
+ list(engine.supported_languages.keys())
if isinstance(engine.supported_languages, dict)
else engine.supported_languages,
'safesearch': engine.safesearch,
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py
index e6739bfe5..fae1755d6 100644
--- a/tests/unit/test_webapp.py
+++ b/tests/unit/test_webapp.py
@@ -157,3 +157,9 @@ class ViewsTestCase(SearxTestCase):
def test_favicon(self):
result = self.app.get('/favicon.ico')
self.assertEqual(result.status_code, 200)
+
+ def test_config(self):
+ result = self.app.get('/config')
+ self.assertEqual(result.status_code, 200)
+ json_result = result.get_json()
+ self.assertTrue(json_result)