diff -u b/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php --- b/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -88,7 +88,7 @@ // Core does not provide any link templates for files so build the canonical // URL manually, but allow contrib to provide link templates. if ($rel == 'canonical' && !$this->hasLinkTemplate('canonical')) { - return Url::fromUri(file_create_url($this->getFileUri(), $options)); + return Url::fromUri(file_create_url($this->getFileUri()), $options); } return parent::toUrl($rel, $options);