mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +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
1 changed files with 1 additions and 1 deletions
|
|
@ -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 a new issue