@adobe/helix-html-pipeline 6.26.3 → 6.26.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +4 -4
- package/src/steps/csp.js +15 -10
- package/src/steps/extract-metadata.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [6.26.5](https://github.com/adobe/helix-html-pipeline/compare/v6.26.4...v6.26.5) (2025-07-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* don't replace 3 spaces in metadata value with comma ([ddb1c8e](https://github.com/adobe/helix-html-pipeline/commit/ddb1c8e3e2de92265b7a5f545cc73c94059ec31f))
|
|
7
|
+
|
|
8
|
+
## [6.26.4](https://github.com/adobe/helix-html-pipeline/compare/v6.26.3...v6.26.4) (2025-07-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* Rename "move-as-header" to "move-to-http-header" ([#910](https://github.com/adobe/helix-html-pipeline/issues/910)) ([fa5b101](https://github.com/adobe/helix-html-pipeline/commit/fa5b10157bb82a4eeed90b7968ac922718ecf659))
|
|
14
|
+
|
|
1
15
|
## [6.26.3](https://github.com/adobe/helix-html-pipeline/compare/v6.26.2...v6.26.3) (2025-07-07)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "6.26.
|
|
3
|
+
"version": "6.26.5",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"unist-util-visit-parents": "6.0.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@adobe/eslint-config-helix": "3.0.
|
|
73
|
+
"@adobe/eslint-config-helix": "3.0.8",
|
|
74
74
|
"@eslint/config-helpers": "0.3.0",
|
|
75
75
|
"@markedjs/html-differ": "5.0.2",
|
|
76
76
|
"@semantic-release/changelog": "6.0.3",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"eslint-import-resolver-exports": "1.0.0-beta.5",
|
|
82
82
|
"eslint-plugin-header": "3.1.1",
|
|
83
83
|
"eslint-plugin-import": "2.32.0",
|
|
84
|
-
"esmock": "2.7.
|
|
84
|
+
"esmock": "2.7.1",
|
|
85
85
|
"husky": "9.1.7",
|
|
86
86
|
"js-yaml": "4.1.0",
|
|
87
87
|
"jsdom": "26.1.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"mocha": "11.7.1",
|
|
91
91
|
"mocha-multi-reporters": "1.5.1",
|
|
92
92
|
"mocha-suppress-logs": "0.6.0",
|
|
93
|
-
"semantic-release": "24.2.
|
|
93
|
+
"semantic-release": "24.2.7"
|
|
94
94
|
},
|
|
95
95
|
"lint-staged": {
|
|
96
96
|
"*.js": "eslint",
|
package/src/steps/csp.js
CHANGED
|
@@ -166,16 +166,17 @@ export function contentSecurityPolicyOnAST(res, tree) {
|
|
|
166
166
|
|| headersCSPRO?.includes(NONCE_AEM)
|
|
167
167
|
) {
|
|
168
168
|
createAndApplyNonceOnAST(res, tree, metaCSP, headersCSP, headersCSPRO);
|
|
169
|
-
}
|
|
170
169
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
if (metaCSP?.properties['move-as-header'] === 'true' || metaCSP?.properties['move-to-http-header'] === 'true') {
|
|
171
|
+
if (!headersCSP) {
|
|
172
|
+
// if we have a CSP in meta but no CSP in headers
|
|
173
|
+
// we can move the CSP from meta to headers, if requested
|
|
174
|
+
res.headers.set('content-security-policy', metaCSP.properties.content);
|
|
175
|
+
remove(tree, null, metaCSP);
|
|
176
|
+
} else {
|
|
177
|
+
delete metaCSP.properties['move-as-header'];
|
|
178
|
+
delete metaCSP.properties['move-to-http-header'];
|
|
179
|
+
}
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
}
|
|
@@ -219,7 +220,11 @@ export function contentSecurityPolicyOnCode(state, res) {
|
|
|
219
220
|
if (contentAttr) {
|
|
220
221
|
({ scriptNonce, styleNonce } = shouldApplyNonce(contentAttr.value, cspHeader));
|
|
221
222
|
|
|
222
|
-
if (!cspHeader
|
|
223
|
+
if (!cspHeader
|
|
224
|
+
&& tag.attrs.find(
|
|
225
|
+
(attr) => (attr.name === 'move-as-header' || attr.name === 'move-to-http-header') && attr.value === 'true',
|
|
226
|
+
)
|
|
227
|
+
) {
|
|
223
228
|
res.headers.set('content-security-policy', contentAttr.value.replaceAll(NONCE_AEM, `'nonce-${nonce}'`));
|
|
224
229
|
return; // don't push the chunk so it gets removed from the response body
|
|
225
230
|
}
|