File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
Plugin/Model/Policy/Renderer Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
+
2
3
All notable changes to this project will be documented in this file.
3
4
4
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.1.0/ )
5
6
and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
6
7
7
8
## [ Unreleased]
9
+
8
10
### Added
11
+
9
12
### Changed
13
+
10
14
### Removed
15
+
11
16
### Fixed
17
+
18
+ ## [ 1.0.1] - 2020-01-01
19
+
20
+ ### Fixed
21
+
22
+ - Fixed issue where the fetch directive was added twice to the CSP header content.
23
+
24
+ ## [ 1.0.0] - 2024-08-02
25
+
26
+ [ 1.0.1 ] : https://github.com/basecom/magento2-csp-split-header/compare/v1.0.0...v1.0.1
27
+ [ 1.0.0 ] : https://github.com/basecom/magento2-csp-split-header/releases/tag/v1.0.0
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function afterRender(
53
53
54
54
if ($ isHeaderSplittingEnabled ) {
55
55
$ this ->registerCspHeaderPlugins ($ response );
56
- $ this ->splitUpCspHeaders ($ response , $ policy -> getId (), $ policyValue );
56
+ $ this ->splitUpCspHeaders ($ response , $ policyValue );
57
57
} else {
58
58
if ($ maxHeaderSize >= $ currentHeaderSize ) {
59
59
$ response ->setHeader ($ headerName , $ policyValue , true );
@@ -87,20 +87,19 @@ private function registerCspHeaderPlugins(HttpResponse $response): void
87
87
/**
88
88
* Make sure that the CSP headers are handled as several headers ("multi-header")
89
89
*/
90
- private function splitUpCspHeaders (HttpResponse $ response , string $ policyId , string $ policyValue ): void
90
+ private function splitUpCspHeaders (HttpResponse $ response , string $ policyValue ): void
91
91
{
92
92
$ headerName = $ this ->getHeaderName ($ response );
93
93
94
94
if (!$ headerName ) {
95
95
return ;
96
96
}
97
97
98
- $ newHeader = $ policyId .' ' .$ policyValue .'; ' ;
99
98
$ maxHeaderSize = $ this ->config ->getMaxHeaderSize ();
100
99
$ newHeaderSize = strlen ($ policyValue );
101
100
102
101
if ($ newHeaderSize <= $ maxHeaderSize ) {
103
- $ this ->contentHeaders [] = $ newHeader ;
102
+ $ this ->contentHeaders [] = $ policyValue ;
104
103
} else {
105
104
$ this ->logger ->error (
106
105
sprintf (
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " basecom/magento2-csp-split-header" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"description" : " N/A" ,
5
5
"type" : " magento2-module" ,
6
6
"license" : [
You can’t perform that action at this time.
0 commit comments