[fix] fix of PR #2225

This commit is contained in:
Alexandre Flament 2020-12-17 16:49:48 +01:00
parent 9b27935f71
commit 5c6a5407a0
2 changed files with 15 additions and 10 deletions

View File

@ -166,6 +166,9 @@ class Search:
if request_params is None:
continue
with threading.RLock():
processor.engine.stats['sent_search_count'] += 1
# append request to list
requests.append((engineref.name, self.search_query.query, request_params))

View File

@ -19,7 +19,9 @@ from searx.search.processors.abstract import EngineProcessor
logger = logger.getChild('search.processor.online')
DEFAULT_PARAMS = {
def default_request_params():
return {
'method': 'GET',
'headers': {},
'data': {},
@ -45,7 +47,7 @@ class OnlineProcessor(EngineProcessor):
return None
# add default params
params.update(DEFAULT_PARAMS)
params.update(default_request_params())
# add an user agent
params['headers']['User-Agent'] = gen_useragent()