mirror of
https://github.com/searxng/searxng
synced 2024-11-03 09:40:20 +00:00
Merge pull request #1101 from allendema/pass-cookies-from-settings
[enh] Allow passing headers/cookies from settings.yml
This commit is contained in:
commit
bbf13a4657
@ -85,6 +85,11 @@ suggestion_xpath = ''
|
||||
cached_xpath = ''
|
||||
cached_url = ''
|
||||
|
||||
cookies = {}
|
||||
headers = {}
|
||||
'''Some engines might offer different result based on cookies or headers.
|
||||
Possible use-case: To set safesearch cookie or header to moderate.'''
|
||||
|
||||
paging = False
|
||||
'''Engine supports paging [True or False].'''
|
||||
|
||||
@ -166,6 +171,9 @@ def request(query, params):
|
||||
'safe_search': safe_search,
|
||||
}
|
||||
|
||||
params['cookies'].update(cookies)
|
||||
params['headers'].update(headers)
|
||||
|
||||
params['url'] = search_url.format(**fargs)
|
||||
params['soft_max_redirects'] = soft_max_redirects
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user