Skip to content

Commit 3cfcaca

Browse files
AC-13833: Refactor SRI mechanism to use filesystem for storage.
1 parent c127a55 commit 3cfcaca

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

app/code/Magento/Csp/Model/SubresourceIntegrityRepository.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ public function getByPath(string $path): ?SubresourceIntegrity
7171
$data = $this->getData();
7272

7373
if (isset($data[$path])) {
74-
return $this->integrityFactory->create(
74+
return new SubresourceIntegrity(
7575
[
76-
"data" => [
77-
"path" => $path,
78-
"hash" => $data[$path]
79-
]
76+
"path" => $path,
77+
"hash" => $data[$path]
8078
]
8179
);
8280
}
@@ -95,12 +93,10 @@ public function getAll(): array
9593
$result = [];
9694

9795
foreach ($this->getData() as $path => $hash) {
98-
$result[] = $this->integrityFactory->create(
96+
$result[] = new SubresourceIntegrity(
9997
[
100-
"data" => [
101-
"path" => $path,
102-
"hash" => $hash
103-
]
98+
"path" => $path,
99+
"hash" => $hash
104100
]
105101
);
106102
}

0 commit comments

Comments
 (0)