@adobe/helix-html-pipeline 6.12.5 → 6.12.7

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.12.7](https://github.com/adobe/helix-html-pipeline/compare/v6.12.6...v6.12.7) (2024-06-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * contentbus-id as surrogate key for 404 response ([e0ac46c](https://github.com/adobe/helix-html-pipeline/commit/e0ac46c0a0ac095bdfa69bf3bd151aaee2ee8224))
7
+
8
+ ## [6.12.6](https://github.com/adobe/helix-html-pipeline/compare/v6.12.5...v6.12.6) (2024-06-19)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * respect x-amz-meta-last-modified ([#627](https://github.com/adobe/helix-html-pipeline/issues/627)) ([#628](https://github.com/adobe/helix-html-pipeline/issues/628)) ([dcb0403](https://github.com/adobe/helix-html-pipeline/commit/dcb040312e764b9bddd269a48c57bc74c59871d7))
14
+
1
15
  ## [6.12.5](https://github.com/adobe/helix-html-pipeline/compare/v6.12.4...v6.12.5) (2024-06-11)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "6.12.5",
3
+ "version": "6.12.7",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -75,7 +75,7 @@
75
75
  "@semantic-release/changelog": "6.0.3",
76
76
  "@semantic-release/git": "10.0.1",
77
77
  "@semantic-release/npm": "12.0.1",
78
- "c8": "10.0.0",
78
+ "c8": "10.1.2",
79
79
  "eslint": "8.57.0",
80
80
  "eslint-import-resolver-exports": "1.0.0-beta.5",
81
81
  "eslint-plugin-header": "3.1.1",
@@ -85,7 +85,7 @@
85
85
  "js-yaml": "4.1.0",
86
86
  "jsdom": "24.1.0",
87
87
  "junit-report-builder": "3.2.1",
88
- "lint-staged": "15.2.5",
88
+ "lint-staged": "15.2.7",
89
89
  "mocha": "10.4.0",
90
90
  "mocha-multi-reporters": "1.5.1",
91
91
  "mocha-suppress-logs": "0.5.1",
@@ -21,7 +21,9 @@ import { getPathKey } from './set-x-surrogate-key-header.js';
21
21
  * @returns {Promise<void>}
22
22
  */
23
23
  export default async function fetch404(state, req, res) {
24
- const { owner, repo, ref } = state;
24
+ const {
25
+ owner, repo, ref, contentBusId,
26
+ } = state;
25
27
  const ret = await state.s3Loader.getObject('helix-code-bus', `${owner}/${repo}/${ref}/404.html`);
26
28
  if (ret.status === 200) {
27
29
  // override last-modified if source-last-modified is set
@@ -38,5 +40,5 @@ export default async function fetch404(state, req, res) {
38
40
 
39
41
  // set 404 keys in any case
40
42
  const pathKey = await getPathKey(state);
41
- res.headers.set('x-surrogate-key', `${pathKey} ${ref}--${repo}--${owner}_404 ${ref}--${repo}--${owner}_code`);
43
+ res.headers.set('x-surrogate-key', `${pathKey} ${contentBusId} ${ref}--${repo}--${owner}_404 ${ref}--${repo}--${owner}_code`);
42
44
  }
@@ -45,7 +45,11 @@ export function updateLastModified(state, res, httpDate) {
45
45
  * @return {string} the last modified date
46
46
  */
47
47
  export function extractLastModified(headers) {
48
- const lastModified = headers.get('x-amz-meta-x-source-last-modified');
48
+ let lastModified = headers.get('x-amz-meta-x-source-last-modified');
49
+ if (lastModified && lastModified !== 'null') {
50
+ return lastModified;
51
+ }
52
+ lastModified = headers.get('x-amz-meta-last-modified');
49
53
  if (lastModified && lastModified !== 'null') {
50
54
  return lastModified;
51
55
  }