@adobe/helix-html-pipeline 1.8.2 → 1.8.3

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,10 @@
1
+ ## [1.8.3](https://github.com/adobe/helix-html-pipeline/compare/v1.8.2...v1.8.3) (2022-10-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **html:** do not skip custom headers for 3xx responses (json) ([396f3f4](https://github.com/adobe/helix-html-pipeline/commit/396f3f457c9acec852d51e427b1ca16a367b7bb3)), closes [#153](https://github.com/adobe/helix-html-pipeline/issues/153)
7
+
1
8
  ## [1.8.2](https://github.com/adobe/helix-html-pipeline/compare/v1.8.1...v1.8.2) (2022-10-05)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
package/src/html-pipe.js CHANGED
@@ -80,6 +80,9 @@ export async function htmlPipe(state, req) {
80
80
  // if content loading produced an error, we're done.
81
81
  log.error(`error running pipeline: ${res.status} ${res.error}`);
82
82
  res.headers.set('x-error', cleanupHeaderValue(res.error));
83
+ if (res.status < 500) {
84
+ await setCustomResponseHeaders(state, req, res);
85
+ }
83
86
  return res;
84
87
  }
85
88
 
package/src/json-pipe.js CHANGED
@@ -89,6 +89,10 @@ export async function jsonPipe(state, req) {
89
89
 
90
90
  // if still not found, return status
91
91
  if (dataResponse.status !== 200) {
92
+ if (dataResponse.status < 500) {
93
+ await fetchMetadata(state, req, dataResponse);
94
+ await setCustomResponseHeaders(state, req, dataResponse);
95
+ }
92
96
  return dataResponse;
93
97
  }
94
98
  const data = dataResponse.body;