private function shouldAddCanonicalTag(array $defaults, Request $request)
    {
        if (!array_key_exists('object', $defaults)) {
            return false;
        }

        $article = $defaults['object'];
        if (!$article instanceof ArticleInterface || !$article instanceof WebspaceBehavior) {
            return false;
        }

        $sulu = $request->get('_sulu');
        if (!$sulu) {
            return false;
        }

        /** @var Webspace $webspace */
        $webspace = $sulu->getAttribute('webspace');
        if (!$webspace) {
            return false;
        }

        $additionalWebspaces = $this->webspaceResolver->resolveAdditionalWebspaces($article);
        if (!$additionalWebspaces || !in_array($webspace->getKey(), $additionalWebspaces)) {
            return false;
        }

        return true;
    }