mirror of
https://github.com/searxng/searxng.git
synced 2025-07-09 03:04:26 -04:00
[fix] sec-fetch-* headers cannot be verified for non-secure requests (#4962)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
60be0f453e
commit
39c50dc013
@ -82,6 +82,12 @@ def filter_request(
|
|||||||
cfg: config.Config,
|
cfg: config.Config,
|
||||||
) -> werkzeug.Response | None:
|
) -> werkzeug.Response | None:
|
||||||
|
|
||||||
|
if not request.is_secure:
|
||||||
|
logger.warning(
|
||||||
|
"Sec-Fetch cannot be verified for non-secure requests (HTTP headers are not set/sent by the client)."
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
# Only check Sec-Fetch headers for supported browsers
|
# Only check Sec-Fetch headers for supported browsers
|
||||||
user_agent = request.headers.get('User-Agent', '')
|
user_agent = request.headers.get('User-Agent', '')
|
||||||
if is_browser_supported(user_agent):
|
if is_browser_supported(user_agent):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user