diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b8f3eb..f8d603d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projec to [Semantic Versioning] (http://semver.org/). For change log format, use [Keep a Changelog] (http://keepachangelog.com/). +## [2.4.1] - 2024-12-04 + +### Fixed + +- `AssetRuntimExtension::preload()` with a finalized path + ## [2.4.0] - 2024-12-04 ### Added diff --git a/src/Extension/AssetRuntimeExtension.php b/src/Extension/AssetRuntimeExtension.php index a84ab9d..26be74b 100644 --- a/src/Extension/AssetRuntimeExtension.php +++ b/src/Extension/AssetRuntimeExtension.php @@ -248,6 +248,8 @@ private function attributes($attrs, ?string $prefix = null): string */ public function preload(string $link, array $parameters = []): string { + $link = $this->getRouter()->finalizePath($link); + if (($push = (false === ($parameters['nopush'] ?? false))) && in_array(md5($link), $this->h2pushCache)) { return $link; } @@ -267,7 +269,7 @@ public function preload(string $link, array $parameters = []): string } if (true === $this->isHeadersSent()) { - return $this->getRouter()->finalizePath($link); + return $link; } $this->sendHeader($header, false); @@ -290,7 +292,7 @@ public function preload(string $link, array $parameters = []): string ); } - return $this->getRouter()->finalizePath($link); + return $link; } /**