fix: harden admin page cache headers

This commit is contained in:
ik
2026-09-16 19:57:05 +07:00
parent eb4d6ccdb0
commit d9f58fb90e
2 changed files with 10 additions and 1 deletions
+4
View File
@@ -27,6 +27,10 @@ def probe(path, expected, authorization=None, method="GET", data=None):
if path.startswith("/api/v1/admin/") and expected == 200:
assert "no-store" in response.headers.get("Cache-Control", "")
assert isinstance(json.load(response), dict)
if path == "/admin" or path.startswith("/admin/"):
if expected == 200:
assert "no-store" in response.headers.get("Cache-Control", "")
assert "noindex" in response.headers.get("X-Robots-Tag", "")
probe("/admin", 401)