@adobe/helix-html-pipeline 6.26.2 → 6.26.4

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [6.26.4](https://github.com/adobe/helix-html-pipeline/compare/v6.26.3...v6.26.4) (2025-07-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 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))
7
+
8
+ ## [6.26.3](https://github.com/adobe/helix-html-pipeline/compare/v6.26.2...v6.26.3) (2025-07-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * set url based on canonical ([#903](https://github.com/adobe/helix-html-pipeline/issues/903)) ([a4960cb](https://github.com/adobe/helix-html-pipeline/commit/a4960cb92fdc1303fff46a417cf0a5c0550ca430))
14
+
1
15
  ## [6.26.2](https://github.com/adobe/helix-html-pipeline/compare/v6.26.1...v6.26.2) (2025-07-01)
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.2",
3
+ "version": "6.26.4",
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.6",
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.0",
84
+ "esmock": "2.7.1",
85
85
  "husky": "9.1.7",
86
86
  "js-yaml": "4.1.0",
87
87
  "jsdom": "26.1.0",
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
- if (metaCSP?.properties['move-as-header'] === 'true') {
172
- if (!headersCSP) {
173
- // if we have a CSP in meta but no CSP in headers
174
- // we can move the CSP from meta to headers, if requested
175
- res.headers.set('content-security-policy', metaCSP.properties.content);
176
- remove(tree, null, metaCSP);
177
- } else {
178
- delete metaCSP.properties['move-as-header'];
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 && tag.attrs.find((attr) => attr.name === 'move-as-header' && attr.value === 'true')) {
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
  }
@@ -254,7 +254,9 @@ export default function extractMetaData(state, req) {
254
254
  meta.url = `${meta.url}.${canonicalExt}`;
255
255
  }
256
256
 
257
- if (!('canonical' in meta)) {
257
+ if ('canonical' in meta) {
258
+ meta.url = meta.canonical;
259
+ } else {
258
260
  meta.canonical = meta.url;
259
261
  }
260
262