fix: harden admin page cache headers
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user