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 a named listener to use with this connection. See :py:class:`stomp.listener.ConnectionListener`
dataset/ETHPy150Open girder/girder/girder/api/rest.py/_setCommonCORSHeaders--crossover with--dataset/ETHPy150Open jasonrbriggs/stomp.py/stomp/listener.py/Publisher.set_listener