Archived
test: verify search engine API acceptance
This commit is contained in:
1 parent
56805a97cf
commit
77fa48c7a2
21 files changed
+512
-109
No files matched your search
@@ -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"
|
||||
Reference in new issue
Block a user