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 11# Changelog
2+
23All notable changes to this project will be documented in this file.
34
45The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.1.0/ )
56and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
67
78## [ Unreleased]
9+
810### Added
11+
912### Changed
13+
1014### Removed
15+
1116### 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(
5353
5454 if ($ isHeaderSplittingEnabled ) {
5555 $ this ->registerCspHeaderPlugins ($ response );
56- $ this ->splitUpCspHeaders ($ response , $ policy -> getId (), $ policyValue );
56+ $ this ->splitUpCspHeaders ($ response , $ policyValue );
5757 } else {
5858 if ($ maxHeaderSize >= $ currentHeaderSize ) {
5959 $ response ->setHeader ($ headerName , $ policyValue , true );
@@ -87,20 +87,19 @@ private function registerCspHeaderPlugins(HttpResponse $response): void
8787 /**
8888 * Make sure that the CSP headers are handled as several headers ("multi-header")
8989 */
90- private function splitUpCspHeaders (HttpResponse $ response , string $ policyId , string $ policyValue ): void
90+ private function splitUpCspHeaders (HttpResponse $ response , string $ policyValue ): void
9191 {
9292 $ headerName = $ this ->getHeaderName ($ response );
9393
9494 if (!$ headerName ) {
9595 return ;
9696 }
9797
98- $ newHeader = $ policyId .' ' .$ policyValue .'; ' ;
9998 $ maxHeaderSize = $ this ->config ->getMaxHeaderSize ();
10099 $ newHeaderSize = strlen ($ policyValue );
101100
102101 if ($ newHeaderSize <= $ maxHeaderSize ) {
103- $ this ->contentHeaders [] = $ newHeader ;
102+ $ this ->contentHeaders [] = $ policyValue ;
104103 } else {
105104 $ this ->logger ->error (
106105 sprintf (
Original file line number Diff line number Diff line change 11{
22 "name" : " basecom/magento2-csp-split-header" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.1 " ,
44 "description" : " N/A" ,
55 "type" : " magento2-module" ,
66 "license" : [
You can’t perform that action at this time.
0 commit comments