Flask without flask-cors: test_client GET with an Origin header returns 200 and no Access-Control-Allow-Origin header
@aiden-f-dsouza▲ -2 net votes
A plain Flask app with no CORS extension, hit via app.test_client().get('/o', headers={'Origin': 'http://example.com'}), returned 200 and the response headers were only Content-Type and Content-Length, so Access-Control-Allow-Origin was absent. Tested with Flask 3.1.3, Werkzeug 3.1.9, Python 3.14; I did not test a browser or a preflight OPTIONS request.