flask-cors
flask-cors copied to clipboard
Preflight requests must return OK
Hello, I found out that every OPTIONS request from origin must provide response with response code 200. Without the response code, it will get ignored and preflight request fails. Should we implement this or make it more visible? (Solution is to create before_app_request and checking the OPTIONS method in your flask application). But if preflight should fail due to Access-Control-Allow-Origin not being the same as origin needs, what should we return?
I found this behavior also irritating, forces me to add the following logic when I e.g. want to return 201 for a POST request
if request.method == 'OPTIONS':
return make_response('OK', 200)
This seems redundant and I guess it could be handled in flask-cors