@adobe/helix-html-pipeline 3.8.9 → 3.8.11

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
+ ## [3.8.11](https://github.com/adobe/helix-html-pipeline/compare/v3.8.10...v3.8.11) (2023-03-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 404 response should include path-based surrogate key ([3600968](https://github.com/adobe/helix-html-pipeline/commit/36009680c7450bbf6c7c1cb54e0d9781a59410dd))
7
+
8
+ ## [3.8.10](https://github.com/adobe/helix-html-pipeline/compare/v3.8.9...v3.8.10) (2023-02-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * prevent prototype pollution ([#265](https://github.com/adobe/helix-html-pipeline/issues/265)) ([6902eb4](https://github.com/adobe/helix-html-pipeline/commit/6902eb4cbd2682633560b1cf6004cd22cf0988b4))
14
+
1
15
  ## [3.8.9](https://github.com/adobe/helix-html-pipeline/compare/v3.8.8...v3.8.9) (2023-02-06)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.8.9",
3
+ "version": "3.8.11",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "hast-util-to-html": "8.0.4",
51
51
  "hast-util-to-string": "2.0.0",
52
52
  "hastscript": "7.2.0",
53
- "jose": "4.11.2",
53
+ "jose": "4.12.0",
54
54
  "mdast-util-gfm-footnote": "1.0.2",
55
55
  "mdast-util-gfm-strikethrough": "1.0.3",
56
56
  "mdast-util-gfm-table": "1.0.7",
@@ -77,14 +77,14 @@
77
77
  "unist-util-visit-parents": "5.1.3"
78
78
  },
79
79
  "devDependencies": {
80
- "@adobe/eslint-config-helix": "2.0.1",
80
+ "@adobe/eslint-config-helix": "2.0.2",
81
81
  "@markedjs/html-differ": "4.0.2",
82
82
  "@semantic-release/changelog": "6.0.2",
83
83
  "@semantic-release/git": "10.0.1",
84
84
  "@semantic-release/npm": "9.0.2",
85
- "c8": "7.12.0",
86
- "eslint": "8.33.0",
87
- "eslint-import-resolver-exports": "1.0.0-beta.4",
85
+ "c8": "7.13.0",
86
+ "eslint": "8.34.0",
87
+ "eslint-import-resolver-exports": "1.0.0-beta.5",
88
88
  "eslint-plugin-header": "3.1.1",
89
89
  "eslint-plugin-import": "2.27.5",
90
90
  "esmock": "2.1.0",
@@ -92,11 +92,11 @@
92
92
  "js-yaml": "4.1.0",
93
93
  "jsdom": "21.1.0",
94
94
  "junit-report-builder": "3.0.1",
95
- "lint-staged": "13.1.0",
95
+ "lint-staged": "13.1.2",
96
96
  "mocha": "10.2.0",
97
97
  "mocha-multi-reporters": "1.5.1",
98
98
  "remark-gfm": "3.0.1",
99
- "semantic-release": "19.0.5"
99
+ "semantic-release": "20.1.0"
100
100
  },
101
101
  "lint-staged": {
102
102
  "*.js": "eslint",
package/src/forms-pipe.js CHANGED
@@ -28,7 +28,7 @@ function error(log, msg, status, response) {
28
28
  * @returns {Object} The converted object
29
29
  */
30
30
  function searchParamsToObject(searchParams) {
31
- const result = {};
31
+ const result = Object.create(null);
32
32
 
33
33
  for (const key of searchParams.keys()) {
34
34
  // get all values association with the key
@@ -37,7 +37,7 @@ function toList(list) {
37
37
  * @returns {object} The block config
38
38
  */
39
39
  function readBlockConfig($block) {
40
- const config = {};
40
+ const config = Object.create(null);
41
41
  selectAll(':scope>div', $block).forEach(($row) => {
42
42
  if ($row?.children[1]) {
43
43
  const [$name, $value] = $row.children;
@@ -82,7 +82,8 @@ export default async function fetchContent(state, req, res) {
82
82
  res.body = ret404.body;
83
83
  res.headers.set('last-modified', ret404.headers.get('last-modified'));
84
84
  res.headers.set('content-type', 'text/html; charset=utf-8');
85
- res.headers.set('x-surrogate-key', `${ref}--${repo}--${owner}_404`);
85
+ const pathKey = await computeSurrogateKey(`${contentBusId}${info.path}`);
86
+ res.headers.set('x-surrogate-key', `${pathKey} ${ref}--${repo}--${owner}_404`);
86
87
  }
87
88
  }
88
89
  }
@@ -15,7 +15,7 @@ import { rewriteUrl } from './utils.js';
15
15
 
16
16
  function yaml(section) {
17
17
  section.meta = selectAll('yaml', section)
18
- .reduce((prev, { payload }) => Object.assign(prev, payload), {});
18
+ .reduce((prev, { payload }) => Object.assign(prev, payload), Object.create(null));
19
19
  return section;
20
20
  }
21
21
 
@@ -13,7 +13,7 @@ import { selectAll } from 'unist-util-select';
13
13
 
14
14
  // Compute the meta information for the section
15
15
  function computeMeta(section) {
16
- return selectAll('yaml', section).reduce((prev, { payload }) => Object.assign(prev, payload), {});
16
+ return selectAll('yaml', section).reduce((prev, { payload }) => Object.assign(prev, payload), Object.create(null));
17
17
  }
18
18
 
19
19
  /**
@@ -48,7 +48,7 @@ function toLowerKeys(obj) {
48
48
  return Object.keys(obj).reduce((prev, key) => {
49
49
  prev[key.toLowerCase()] = obj[key];
50
50
  return prev;
51
- }, {});
51
+ }, Object.create(null));
52
52
  }
53
53
 
54
54
  /**
@@ -91,7 +91,7 @@ export class Modifiers {
91
91
  * @returns {object} An object containing an array of key/value pairs for every glob
92
92
  */
93
93
  static fromModifierSheet(sheet, keyFilter = () => true) {
94
- const res = {};
94
+ const res = Object.create(null);
95
95
  for (let row of sheet) {
96
96
  row = toLowerKeys(row);
97
97
  const {
@@ -140,7 +140,7 @@ export class Modifiers {
140
140
  * @return {object} the modifier
141
141
  */
142
142
  getModifiers(path) {
143
- const modifiers = {};
143
+ const modifiers = Object.create(null);
144
144
  for (const { pat, mods } of this.modifiers) {
145
145
  if (pat === path || (pat instanceof RegExp && pat.test(path))) {
146
146
  for (const { key, value } of mods) {
@@ -41,7 +41,7 @@ function getAttributes(section) {
41
41
  // Add system properties as data-hlx-*
42
42
  const attributes = attributeKeys
43
43
  .filter((k) => SYSTEM_HTML_ATTRIBUTES.indexOf(k) > -1)
44
- .reduce((result, attr) => Object.assign(result, { [`data-${HELIX_NAMESPACE}${attr}`]: toHtmlAttribute(section.meta[attr]) }), {});
44
+ .reduce((result, attr) => Object.assign(result, { [`data-${HELIX_NAMESPACE}${attr}`]: toHtmlAttribute(section.meta[attr]) }), Object.create(null));
45
45
  return attributeKeys
46
46
  .filter((k) => [...SYSTEM_HTML_ATTRIBUTES, ...SYSTEM_META_PROPERTIES].indexOf(k) === -1)
47
47
  .reduce((result, attr) => {