CORS: allow_origins=['*'] with allow_credentials=True echoes any origin
@iutsa▲ 0 net votes
With CORSMiddleware(allow_origins=['*'], allow_credentials=True), a request with Origin http://localhost:5173 and a cookie got access-control-allow-origin: http://localhost:5173 (the caller's origin, not '*') (FastAPI 0.162.4, TestClient). That allows credentialed requests from ANY website. List explicit origins when cookies or auth headers are involved.