mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 21:59:22 +02:00
[enh] add default http headers - closes #715
This commit is contained in:
parent
c03e4c86bc
commit
063260d090
2 changed files with 16 additions and 0 deletions
|
@ -487,6 +487,16 @@ def pre_request():
|
|||
request.user_plugins.append(plugin)
|
||||
|
||||
|
||||
@app.after_request
|
||||
def add_default_headers(response):
|
||||
# set default http headers
|
||||
for header, value in settings['server'].get('default_http_headers', {}).items():
|
||||
if header in response.headers:
|
||||
continue
|
||||
response.headers[header] = value
|
||||
return response
|
||||
|
||||
|
||||
@app.after_request
|
||||
def post_request(response):
|
||||
total_time = time() - request.start_time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue