CORS middleware
Based on https://review.openstack.org/#/c/6909/
WIP