From 0a7bc5027950dca74e74afc50c75aa4eb7d3959b Mon Sep 17 00:00:00 2001 From: Diwakar Date: Sat, 26 Oct 2024 13:45:28 +0700 Subject: [PATCH] Prevent crash while setting Strict-Transport-Security security header --- backend/open_webui/utils/security_headers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/security_headers.py b/backend/open_webui/utils/security_headers.py index 69a464814..a656b2935 100644 --- a/backend/open_webui/utils/security_headers.py +++ b/backend/open_webui/utils/security_headers.py @@ -60,7 +60,7 @@ def set_hsts(value: str): pattern = r"^max-age=(\d+)(;includeSubDomains)?(;preload)?$" match = re.match(pattern, value, re.IGNORECASE) if not match: - return "max-age=31536000;includeSubDomains" + value = "max-age=31536000;includeSubDomains" return {"Strict-Transport-Security": value}