Skip to content

Commit 64ec736

Browse files
committed
refac
1 parent b36e55c commit 64ec736

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

backend/open_webui/utils/security_headers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def set_security_headers() -> Dict[str, str]:
2828
- x-frame-options
2929
- x-permitted-cross-domain-policies
3030
- content-security-policy
31+
- reporting-endpoints
3132
3233
Each environment variable is associated with a specific setter function
3334
that constructs the header. If the environment variable is set, the
@@ -47,6 +48,7 @@ def set_security_headers() -> Dict[str, str]:
4748
"XFRAME_OPTIONS": set_xframe,
4849
"XPERMITTED_CROSS_DOMAIN_POLICIES": set_xpermitted_cross_domain_policies,
4950
"CONTENT_SECURITY_POLICY": set_content_security_policy,
51+
"REPORTING_ENDPOINTS": set_reporting_endpoints,
5052
}
5153

5254
for env_var, setter in header_setters.items():
@@ -131,3 +133,8 @@ def set_xpermitted_cross_domain_policies(value: str):
131133
# Set Content-Security-Policy response header
132134
def set_content_security_policy(value: str):
133135
return {"Content-Security-Policy": value}
136+
137+
138+
# Set Reporting-Endpoints response header
139+
def set_reporting_endpoints(value: str):
140+
return {"Reporting-Endpoints": value}

0 commit comments

Comments
 (0)