From 95e4a9353a600a8a3212cf0a9ce8690c4843f076 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 20 Oct 2013 20:20:10 +0200 Subject: [PATCH] [fix] request header parametering --- searx/engines/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 6bfcdab2b..5a8de79f8 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -69,20 +69,20 @@ def search(query, request, selected_engines): for ename, engine in engines.items(): if ename not in selected_engines: continue - headers = default_request_params() - headers['User-Agent'] = user_agent - request_params = engine.request(query, headers) + request_params = default_request_params() + request_params['headers']['User-Agent'] = user_agent + request_params = engine.request(query, request_params) callback = make_callback(ename, results, engine.response) if request_params['method'] == 'GET': req = grequests.get(request_params['url'] - ,headers=headers + ,headers=request_params['headers'] ,hooks=dict(response=callback) ,cookies = request_params['cookies'] ) else: req = grequests.post(request_params['url'] ,data=request_params['data'] - ,headers=headers + ,headers=request_params['headers'] ,hooks=dict(response=callback) ,cookies = request_params['cookies'] )