def _setCommonCORSHeaders():
    if not cherrypy.request.headers.get('origin'):
        # If there is no origin header, this is not a cross origin request
        return

    origins = ModelImporter.model('setting').get(SettingKey.CORS_ALLOW_ORIGIN)
    if origins:
        cherrypy.response.headers['Access-Control-Allow-Origin'] = origins
        cherrypy.response.headers['Access-Control-Allow-Credentials'] = 'true'
Set CORS headers that should be passed back with either a preflight OPTIONS
dataset/ETHPy150Open girder/girder/girder/api/rest.py/_setCommonCORSHeaders