Skip to content

Commit db9691b

Browse files
committed
Merge branch 'MC-30823' of github.com:magento-qwerty/magento2ce into 2.3-develop
2 parents 83d0097 + fb34ca6 commit db9691b

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function convert($source)
4343
}
4444
}
4545
$policyConfig[$id]['hosts'] = array_unique($policyConfig[$id]['hosts']);
46-
$policyConfig[$id]['hashes'] = array_unique($policyConfig[$id]['hashes']);
4746
}
4847

4948
return $policyConfig;

dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/csp_whitelist.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<values>
1212
<value id="mage-base" type="host">https://magento.com</value>
1313
<value id="hash" type="hash" algorithm="sha256">B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=</value>
14+
<value id="hash2" type="hash" algorithm="sha256">B3yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=</value>
1415
</values>
1516
</policy>
1617
<policy id="media-src">

dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/csp_whitelist.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<values>
1212
<value id="devdocs-base" type="host">https://devdocs.magento.com</value>
1313
<value id="mage-base" type="host">http://magento.com</value>
14+
<value id="hash3" type="hash" algorithm="sha256">B4yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=</value>
1415
</values>
1516
</policy>
1617
</policies>

dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ public function testCollecting(): void
5353
if ($policy->getId() === 'object-src') {
5454
$this->assertInstanceOf(FetchPolicy::class, $policy);
5555
$this->assertEquals(['http://magento.com', 'https://devdocs.magento.com'], $policy->getHostSources());
56-
$this->assertEquals(['B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256'], $policy->getHashes());
56+
$this->assertEquals(
57+
[
58+
'B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256',
59+
'B3yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256',
60+
'B4yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256'
61+
],
62+
$policy->getHashes()
63+
);
5764
$objectSrcChecked = true;
5865
} elseif ($policy->getId() === 'media-src') {
5966
$this->assertInstanceOf(FetchPolicy::class, $policy);

0 commit comments

Comments
 (0)