mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 08:56:39 +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)?$"
|
pattern = r"^max-age=(\d+)(;includeSubDomains)?(;preload)?$"
|
||||||
match = re.match(pattern, value, re.IGNORECASE)
|
match = re.match(pattern, value, re.IGNORECASE)
|
||||||
if not match:
|
if not match:
|
||||||
return "max-age=31536000;includeSubDomains"
|
value = "max-age=31536000;includeSubDomains"
|
||||||
return {"Strict-Transport-Security": value}
|
return {"Strict-Transport-Security": value}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user