diff --git a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php index 0d23358..c41029b 100644 --- a/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php +++ b/core/modules/hal/src/Normalizer/ContentEntityNormalizer.php @@ -192,7 +192,10 @@ protected function getEntityUri(EntityInterface $entity, array $context = []) { return $entity->url('canonical', []); } $url = $entity->urlInfo('canonical', ['absolute' => TRUE]); - $generated_url = $url->setRouteParameter('_format', 'hal_json')->toString(TRUE); + if (!$url->isExternal()) { + $url->setRouteParameter('_format', 'hal_json'); + } + $generated_url = $url->toString(TRUE); $this->addCacheableDependency($context, $generated_url); return $generated_url->getGeneratedUrl(); }