public function setFrameAncestorsHeader()
    {
        /** @var SettingsStorage $settingsStorage */
        $settingsStorage = $this->getServiceLocator()->get(SettingsStorage::SERVICE_ID);
        $whitelistedSources = $settingsStorage->get(CspHeaderSettingsInterface::CSP_HEADER_SETTING);

        if ($whitelistedSources === null) {
            $whitelistedSources = ["'none'"];
        }

        // Wrap directives in quotes
        if (in_array($whitelistedSources, ['self', 'none'])) {
            $whitelistedSources = ["'" . $whitelistedSources . "'"];
        }

        if ($whitelistedSources === 'list') {
            $whitelistedSources = json_decode($settingsStorage->get(CspHeaderSettingsInterface::CSP_HEADER_LIST), true);
        }

        if (!is_array($whitelistedSources)) {
            $whitelistedSources = [$whitelistedSources];
        }

        header(sprintf(
            'Content-Security-Policy: frame-ancestors %s',
            implode(' ', $whitelistedSources)
        ));
    }