1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-19 19:00:10 +01:00

Merge branch 'master' into ne/improve-infinite-scroll

This commit is contained in:
Noémi Ványi 2019-06-30 13:45:09 +02:00 committed by GitHub
commit 6c75052874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -91,3 +91,5 @@ logger.info('Initialisation done')
if 'SEARX_SECRET' in environ: if 'SEARX_SECRET' in environ:
settings['server']['secret_key'] = environ['SEARX_SECRET'] settings['server']['secret_key'] = environ['SEARX_SECRET']
if 'SEARX_BIND_ADDRESS' in environ:
settings['server']['bind_address'] = environ['SEARX_BIND_ADDRESS']

View File

@ -846,7 +846,7 @@ def clear_cookies():
@app.route('/config') @app.route('/config')
def config(): def config():
return jsonify({'categories': categories.keys(), return jsonify({'categories': list(categories.keys()),
'engines': [{'name': engine_name, 'engines': [{'name': engine_name,
'categories': engine.categories, 'categories': engine.categories,
'shortcut': engine.shortcut, 'shortcut': engine.shortcut,
@ -854,7 +854,7 @@ def config():
'paging': engine.paging, 'paging': engine.paging,
'language_support': engine.language_support, 'language_support': engine.language_support,
'supported_languages': 'supported_languages':
engine.supported_languages.keys() list(engine.supported_languages.keys())
if isinstance(engine.supported_languages, dict) if isinstance(engine.supported_languages, dict)
else engine.supported_languages, else engine.supported_languages,
'safesearch': engine.safesearch, 'safesearch': engine.safesearch,

View File

@ -157,3 +157,9 @@ class ViewsTestCase(SearxTestCase):
def test_favicon(self): def test_favicon(self):
result = self.app.get('/favicon.ico') result = self.app.get('/favicon.ico')
self.assertEqual(result.status_code, 200) 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)