'Enable or disable the end-point and configure the whitelist.'

def _configure(self, is_enabled, whitelist=None):

    config = XDomainProxyConfiguration.current()
    config.enabled = is_enabled
    if whitelist:
        config.whitelist = '\n'.join(whitelist)
    config.save()
    cache.clear()
