Commit 15a745f
test: lock CORS preflight allows write methods
The CORS defaults already ship correct (`["*"]`), but nothing guarded
the preflight contract. Add a regression test that sends an
`OPTIONS /api/decks/` preflight from the shipped dev origin
(`http://localhost:5173`) and asserts `POST`/`PUT` appear in
`Access-Control-Allow-Methods`, exercising the real
settings → lite-bootstrap → Starlette CORS middleware wiring.
Ported from modern-python/litestar-sqlalchemy-template#34. Verified it
fails (preflight 400, POST absent) if the methods default regresses to
`[""]`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3dd4a6d commit 15a745f
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments