Update app.py
Browse files
app.py
CHANGED
|
@@ -156,7 +156,6 @@ async def secure_origin(request: Request, call_next):
|
|
| 156 |
if path in _HF_PREVIEW_PATHS:
|
| 157 |
# X-Frame-Options cannot express an allowlist. Omit it only on these
|
| 158 |
# harmless GET endpoints and use CSP's exact parent-origin allowlist.
|
| 159 |
-
response.headers.pop("X-Frame-Options", None)
|
| 160 |
response.headers["Content-Security-Policy"] = _HF_FRAME_ANCESTORS
|
| 161 |
else:
|
| 162 |
response.headers["X-Frame-Options"] = "SAMEORIGIN" if path.startswith("/admin") else "DENY"
|
|
|
|
| 156 |
if path in _HF_PREVIEW_PATHS:
|
| 157 |
# X-Frame-Options cannot express an allowlist. Omit it only on these
|
| 158 |
# harmless GET endpoints and use CSP's exact parent-origin allowlist.
|
|
|
|
| 159 |
response.headers["Content-Security-Policy"] = _HF_FRAME_ANCESTORS
|
| 160 |
else:
|
| 161 |
response.headers["X-Frame-Options"] = "SAMEORIGIN" if path.startswith("/admin") else "DENY"
|