I\'d like to make a response with the \"Access-Control-Allow-Origin\" header been set all by myself, while it\'s seems messing up to figure out where the \"HTTP_ORIGIN\" paramet
here is example :
from flask import request
...
allow_origin_list = ['https://example.com', 'http://example.com']
if 'HTTP_ORIGIN' in request.environ and request.environ['HTTP_ORIGIN'] in allow_origin_list:
response.headers.add('Access-Control-Allow-Origin', request.environ['HTTP_ORIGIN'] )
response.headers.add('Access-Control-Allow-Headers', 'access-control-allow-origin,content-type')
response.headers.add('Access-Control-Allow-Methods', 'GET,POST')