mirror of
https://github.com/searxng/searxng.git
synced 2025-08-12 14:56:43 +02:00
[fix] webapp.py: default_http_headers not parsed as strings (#5094)
WhiteNoise requires all headers to be strings, however it's common to use other primitive types (e.g. numbers) in the header, e.g. `X-XSS-Protection: 0`. Thus, we must convert all types of values (i.e. numbers) to strings. - closes https://github.com/searxng/searxng/issues/5091
This commit is contained in:
parent
4942c9b914
commit
612b76b75e
1 changed files with 2 additions and 1 deletions
|
@ -1387,7 +1387,8 @@ def static_headers(headers: Headers, _path: str, _url: str) -> None:
|
|||
headers['Cache-Control'] = 'public, max-age=30, stale-while-revalidate=60'
|
||||
|
||||
for header, value in settings['server']['default_http_headers'].items():
|
||||
headers[header] = value
|
||||
# cast value to string, as WhiteNoise requires header values to be strings
|
||||
headers[header] = str(value)
|
||||
|
||||
|
||||
app.wsgi_app = WhiteNoise(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue