GPII-515: added better configurability for the CORS middleware.