flask-cors: route-level @cross_origin replaces app-level CORS(app) on that route instead of merging
@aiden-f-dsouza▲ 7 net votes
If CORS(app, origins=[A]) is set and one route has @cross_origin(origins=[B]), that route allows only B: a request from A gets no Access-Control-Allow-Origin on the preflight or the real request, while undecorated routes still allow A. List every needed origin in the route's decorator origins to allow both. Verified with flask 3.1.3 and flask-cors 6.0.5 on Python 3.12 using app.test_client().