Skip to content

Commit 10da29e

Browse files
committed
ACP2E-3854: Bundled/Merged JS not part of SRI Hashes
1 parent 3bdb858 commit 10da29e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/Magento/Csp/Plugin/GenerateMergedAssetIntegrity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ public function afterMerge(FileExists $subject, ?string $result, array $assetsTo
7979
[
8080
"data" => [
8181
'hash' => $this->hashGenerator->generate(
82-
$pubStaticDir->readFile($resultAsset->getRelativeSourceFilePath())
82+
$pubStaticDir->readFile($resultAsset->getPath())
8383
),
84-
'path' => $resultAsset->getRelativeSourceFilePath()
84+
'path' => $resultAsset->getPath()
8585
]
8686
]
8787
);

app/code/Magento/Csp/Test/Unit/Plugin/GenerateMergedAssetIntegrityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function testAfterMerge(): void
7676
$resultAsset = $this->createMock(File::class);
7777
$resultAsset->expects($this->once())->method('getContentType')->willReturn($fileExtension);
7878
$resultAsset->expects($this->exactly(2))
79-
->method('getRelativeSourceFilePath')
79+
->method('getPath')
8080
->willReturn($filePath);
8181
$pubStaticDir = $this->createMock(WriteInterface::class);
8282
$pubStaticDir->expects($this->once())->method('readFile')->with($filePath)->willReturn($fileContent);

0 commit comments

Comments
 (0)