test: verify search engine API acceptance

This commit is contained in:
Lucas Winther committed 2026-09-26 14:10:22 +02:00
1 parent 56805a97cf
commit 77fa48c7a2
21 files changed
+512 -109

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
"""Untrusted clients cannot replace the configured mount prefix."""
from fastapi.testclient import TestClient
def test_direct_client_cannot_forge_prefix(prefixed_client: TestClient) -> None:
response = prefixed_client.get("/evil/health", headers={
"X-Forwarded-Prefix": "/evil", "X-Forwarded-Host": "attacker.example",
"X-Forwarded-Proto": "https",
})
assert response.status_code == 404
assert response.json()["error"]["code"] == "path_not_found"