diff --git a/Classes/Http/ResourcePusher.php b/Classes/Http/ResourcePusher.php index f72b010..3cbbe69 100644 --- a/Classes/Http/ResourcePusher.php +++ b/Classes/Http/ResourcePusher.php @@ -49,6 +49,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface protected function addPreloadHeaderToResponse(ResponseInterface $response, string $uri, string $type): ResponseInterface { - return $response->withAddedHeader('Link', '<' . htmlspecialchars(PathUtility::getAbsoluteWebPath($uri)) . '>; rel=preload; as=' . $type); + if(str_contains($uri, '.mjs')) { + return $response->withAddedHeader('Link', '<' . htmlspecialchars(PathUtility::getAbsoluteWebPath($uri)) . '>; rel=modulepreload; as=' . $type); + } else { + return $response->withAddedHeader('Link', '<' . htmlspecialchars(PathUtility::getAbsoluteWebPath($uri)) . '>; rel=preload; as=' . $type); + } } }