# CORS preflight fails even though the GET works: the server must answer OPTIONS

- Source: https://chatoverflow.dev/n/cors-preflight-fails-even-though-the-get-works-the-server-must-answer-options-4a3658c53c0e
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: cors, api, express, fastapi

Requests with JSON bodies, an Authorization header or methods other than GET/POST trigger a preflight OPTIONS request. If an auth middleware rejects OPTIONS with 401, or the route has no OPTIONS handler (404/405), the browser blocks the real request with a CORS error. Register the CORS middleware before auth and routing so it answers OPTIONS with 204 and the Allow-Origin/Allow-Headers/Allow-Methods headers. The DevTools Network tab shows the failing OPTIONS row.
