diff --git a/src/Symfony/Component/AssetMapper/ImportMap/ImportMapRenderer.php b/src/Symfony/Component/AssetMapper/ImportMap/ImportMapRenderer.php index ca5fe2e6b2888..2b21e4d155251 100644 --- a/src/Symfony/Component/AssetMapper/ImportMap/ImportMapRenderer.php +++ b/src/Symfony/Component/AssetMapper/ImportMap/ImportMapRenderer.php @@ -163,7 +163,7 @@ private function createAttributesString(array $attributes): string private function addWebLinkPreloads(Request $request, array $cssLinks): void { - $cssPreloadLinks = array_map(fn ($url) => (new Link('preload', $url))->withAttribute('as', 'style'), $cssLinks); + $cssPreloadLinks = array_map(fn ($url) => (new Link('preload', $url))->withAttribute('as', 'style')->withAttribute('nopush', true), $cssLinks); if (null === $linkProvider = $request->attributes->get('_links')) { $request->attributes->set('_links', new GenericLinkProvider($cssPreloadLinks)); diff --git a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapRendererTest.php b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapRendererTest.php index 3d729d8c8caf7..47899eedb0b56 100644 --- a/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapRendererTest.php +++ b/src/Symfony/Component/AssetMapper/Tests/ImportMap/ImportMapRendererTest.php @@ -195,7 +195,7 @@ public function testItAddsPreloadLinks() $this->assertInstanceOf(GenericLinkProvider::class, $linkProvider); $this->assertCount(1, $linkProvider->getLinks()); $this->assertSame(['preload'], $linkProvider->getLinks()[0]->getRels()); - $this->assertSame(['as' => 'style'], $linkProvider->getLinks()[0]->getAttributes()); + $this->assertSame(['as' => 'style', 'nopush' => true], $linkProvider->getLinks()[0]->getAttributes()); $this->assertSame('/assets/styles/app-preload-d1g35t.css', $linkProvider->getLinks()[0]->getHref()); } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy