Переглянути джерело

Prevent crash while setting Strict-Transport-Security security header

Diwakar 6 місяців тому
батько
коміт
0a7bc50279
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      backend/open_webui/utils/security_headers.py

+ 1 - 1
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}