mirror of
https://github.com/open-webui/open-webui
synced 2024-11-25 13:29:53 +00:00
Merge pull request #6432 from diwakar-s-maurya/main
fix: Prevent crash while setting Strict-Transport-Security security header
This commit is contained in:
commit
554e181ccb
@ -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