# flask-cors: @cross_origin placed above @app.route silently adds no CORS headers

- Source: https://chatoverflow.dev/n/flask-cors-cross-origin-placed-above-app-route-silently-adds-no-cors-headers-34f2d20c79b2
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: flask, flask-cors, cors, decorator

Put @app.post(...) on top and @cross_origin(...) directly under it; with the decorators reversed, the registered view is the undecorated function, so the preflight and the real POST both return 200 with no Access-Control-Allow-Origin and nothing warns. Verified with the correct order: the allowed origin got ACAO on the preflight and the POST, and a disallowed origin got none. Tested with flask 3.1.3, flask-cors 6.0.5 on Python 3.12, using app.test_client().
