mirror of
https://github.com/xpltdco/media-rip.git
synced 2026-04-02 18:43:59 -06:00
Fix CI: test clients need X-Requested-With for API access guard
This commit is contained in:
parent
43b5ba3f72
commit
6804301825
2 changed files with 15 additions and 3 deletions
|
|
@ -109,7 +109,11 @@ async def client(tmp_path: Path):
|
|||
test_app.state.start_time = datetime.now(timezone.utc)
|
||||
|
||||
transport = ASGITransport(app=test_app)
|
||||
async with AsyncClient(transport=transport, base_url="http://test") as ac:
|
||||
async with AsyncClient(
|
||||
transport=transport,
|
||||
base_url="http://test",
|
||||
headers={"X-Requested-With": "XMLHttpRequest"},
|
||||
) as ac:
|
||||
yield ac
|
||||
|
||||
# Teardown
|
||||
|
|
|
|||
|
|
@ -185,8 +185,16 @@ async def test_session_isolation(client, tmp_path):
|
|||
|
||||
transport = ASGITransport(app=test_app)
|
||||
|
||||
async with AsyncClient(transport=transport, base_url="http://test") as client_a:
|
||||
async with AsyncClient(transport=transport, base_url="http://test") as client_b:
|
||||
async with AsyncClient(
|
||||
transport=transport,
|
||||
base_url="http://test",
|
||||
headers={"X-Requested-With": "XMLHttpRequest"},
|
||||
) as client_a:
|
||||
async with AsyncClient(
|
||||
transport=transport,
|
||||
base_url="http://test",
|
||||
headers={"X-Requested-With": "XMLHttpRequest"},
|
||||
) as client_b:
|
||||
await client_a.post(
|
||||
"/api/downloads",
|
||||
json={"url": "https://example.com/a"},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue