Skip to content

Commit daeca84

Browse files
authored
Merge pull request #45 from stape-io/feature/remove-unnecessary-csp
Removed unnecessary CSP rules
2 parents 443481a + b436319 commit daeca84

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
v1.0.26
4+
- removed unneeded CSP rules
5+
36
v1.0.24
47
- added caching of cookie domain when generating _sbp cookie
58
- Fixed issue with the overridden price formatter pattern

Plugin/CspObserverPlugin.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,21 @@ public function __construct(
5151
*/
5252
public function beforeExecute(ObserverInterface $subject, $observer)
5353
{
54-
// phpcs:disable
55-
$customDomain = parse_url($this->configProvider->getCustomDomain() ?? '', PHP_URL_HOST);
56-
// phpcs:enable
57-
54+
$customDomain = $this->configProvider->getCustomDomain();
5855
if (!$this->configProvider->isActive() || empty($customDomain)) {
5956
return [$observer];
6057
}
6158

6259
$scriptPolicy = $this->fetchPolicyFactory->create([
6360
'id' => 'script-src',
6461
'hostSources' => [$customDomain],
65-
'schemeSources' => ['https'],
6662
'noneAllowed' => false,
67-
'selfAllowed' => true,
68-
'inlineAllowed' => true
6963
]);
7064

7165
$connectPolicy = $this->fetchPolicyFactory->create([
7266
'id' => 'connect-src',
7367
'hostSources' => [$customDomain],
74-
'schemeSources' => ['https'],
7568
'noneAllowed' => false,
76-
'selfAllowed' => true,
77-
'inlineAllowed' => true
7869
]);
7970

8071
$this->dynamicCollector->add($scriptPolicy);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": [
66
"GPL-3.0-only"
77
],
8-
"version": "1.0.25",
8+
"version": "1.0.26",
99
"require": {
1010
"php": ">=7.4.0",
1111
"jeremykendall/php-domain-parser": "^6.0"

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22

33
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
4-
<module name="Stape_Gtm" schema_version="1.0.25" setup_version="1.0.25">
4+
<module name="Stape_Gtm" schema_version="1.0.26" setup_version="1.0.26">
55
<sequence>
66
<module name="Magento_Backend" />
77
<module name="Magento_Catalog" />

0 commit comments

Comments
 (0)