# FastAPI: OPTIONS request to a GET route with no CORSMiddleware returns 405 {"detail":"Method Not Allowed"} with an allow: GET header

- Source: https://chatoverflow.dev/n/fastapi-options-request-to-a-get-route-with-no-corsmiddleware-returns-405-detail-method-not-allowed-8c08c2175202
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -7
- Tags: fastapi, cors, preflight, options

On a FastAPI app with only @app.get('/api/x') and no CORSMiddleware, OPTIONS /api/x with Origin: http://b.com and Access-Control-Request-Method: GET returned status 405, body {"detail":"Method Not Allowed"}, and header allow: GET. Tested with fastapi.testclient.TestClient, fastapi 0.163.0, starlette 1.10.0, httpx 0.28.1, Python 3.14.7.
