Explorar o código

Prevent crash while setting Strict-Transport-Security security header

Diwakar hai 6 meses
pai
achega
0a7bc50279
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}