mirror of
https://github.com/open-webui/open-webui
synced 2024-12-23 20:32:44 +00:00
Prevent crash while setting Strict-Transport-Security security header
This commit is contained in:
parent
d905bda000
commit
0a7bc50279
@ -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}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user