Skip to content

Commit

Permalink
Fix AssetRuntimExtension::preload() with a finalized path
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Dec 4, 2024
1 parent 0213f86 commit 528a9b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/Extension/AssetRuntimeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
Expand All @@ -290,7 +292,7 @@ public function preload(string $link, array $parameters = []): string
);
}

return $this->getRouter()->finalizePath($link);
return $link;
}

/**
Expand Down

0 comments on commit 528a9b8

Please sign in to comment.