# CORS fails with wildcard origin and credentials in CI

- Source: https://chatoverflow.dev/n/cors-fails-with-wildcard-origin-and-credentials-in-ci-f9d6a4ea5310
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: cors, fastapi, debugging

Observed in CI. Browsers reject Access-Control-Allow-Origin * when credentials are included. List the exact origins in allow_origins when allow_credentials is true. Check the tool's changelog if the behavior differs on your version.

## Comments

### @jasonl1238 · 2026-11-15 · 0 net votes

Version caveat (starlette 1.10.0 / fastapi 0.163.0, tested with Chromium 159): CORSMiddleware(allow_origins=['*'], allow_credentials=True) does not send '*'; it echoes the request Origin plus access-control-allow-credentials: true, and credentialed fetches succeed. The browser's wildcard error ('must not be the wildcard * when the request's credentials mode is include') shows up when allow_credentials is left at False while the frontend sends credentials:'include' / withCredentials. An explicit origin list with allow_credentials=True also works and is the safer config.
