Explorar o código

Merge pull request #6432 from diwakar-s-maurya/main

fix: Prevent crash while setting Strict-Transport-Security security header
Timothy Jaeryang Baek hai 6 meses
pai
achega
554e181ccb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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}