diff --git a/Classes/Middleware/PrepareMiddleware.php b/Classes/Middleware/PrepareMiddleware.php index 89599c9f34a..f099d0143db 100644 --- a/Classes/Middleware/PrepareMiddleware.php +++ b/Classes/Middleware/PrepareMiddleware.php @@ -70,7 +70,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface $pushHeaders = (array) $this->httpPushService->getHttpPushHeaders((string) $response->getBody()); foreach ($pushHeaders as $pushHeader) { - $response = $response->withAddedHeader('Link', '<' . $pushHeader['path'] . '>; rel=preload; as=' . $pushHeader['type']); + if (mb_detect_encoding($pushHeader['path'], 'ASCII', true)) { + $response = $response->withAddedHeader('Link', '<' . $pushHeader['path'] . '>; rel=preload; as=' . $pushHeader['type']); + } } return $response; diff --git a/Classes/Service/HttpPush/AbstractHttpPush.php b/Classes/Service/HttpPush/AbstractHttpPush.php index 9ec217c4846..2f2172f737b 100644 --- a/Classes/Service/HttpPush/AbstractHttpPush.php +++ b/Classes/Service/HttpPush/AbstractHttpPush.php @@ -14,7 +14,6 @@ public function __invoke(HttpPushHeaderEvent $event): void foreach ($event->getExtensions() as $extension) { if ($this->canHandleExtension($extension)) { $event->setHeaders(array_merge($event->getHeaders(), $this->getHeaders($event->getContent()))); - ; } } } diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index adc96be9aae..5cb4ec5d7d6 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -165,25 +165,25 @@ services: SFC\Staticfilecache\Service\HttpPush\ScriptHttpPush: tags: - name: event.listener - identifier: 'StyleHttpPush' + identifier: 'ScriptHttpPush' event: SFC\Staticfilecache\Event\HttpPushHeaderEvent SFC\Staticfilecache\Service\HttpPush\ImageHttpPush: tags: - name: event.listener - identifier: 'StyleHttpPush' + identifier: 'ImageHttpPush' event: SFC\Staticfilecache\Event\HttpPushHeaderEvent SFC\Staticfilecache\Service\HttpPush\FontHttpPush: tags: - name: event.listener - identifier: 'StyleHttpPush' + identifier: 'FontHttpPush' event: SFC\Staticfilecache\Event\HttpPushHeaderEvent SFC\Staticfilecache\Service\HttpPush\SvgHttpPush: tags: - name: event.listener - identifier: 'StyleHttpPush' + identifier: 'SvgHttpPush' event: SFC\Staticfilecache\Event\HttpPushHeaderEvent SFC\Staticfilecache\Generator\ConfigGenerator: