Error AtlasError Documentation and Resolution

CORS response contains multiple allowed-origin values

Reason: Multiple CORS header 'Access-Control-Allow-Origin' not allowed

The response supplies multiple Access-Control-Allow-Origin headers or an invalid list of origins. A browser expects one valid value, so adding another header at a proxy can break an otherwise correct API.

Multiple CORS Access-Control-Allow-Origin headerscors
Reason: Multiple CORS header 'Access-Control-Allow-Origin' not allowed
  • Both application middleware and a reverse proxy append the CORS header.
  • Configuration puts several origins into one comma-separated header value.
  • Repeated middleware registration adds the header more than once.
  1. Inspect the final response received by the browser, not only the application's internal headers. Compare responses through the public proxy and the intended application path.
  2. Choose one layer to own the allow-origin policy and remove duplicate header emission at other layers.
  3. For several trusted origins, match the request Origin against an allowlist and emit only that matching origin in the response. Do not return the whole list.
  4. Use Vary: Origin when the value depends on the request. Verify both success and error responses have exactly one valid allow-origin value.
MDN: Multiple CORS Access-Control-Allow-Origin headers not allowed