@adobe/helix-html-pipeline 1.0.3 → 1.0.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,10 @@
1
+ ## [1.0.4](https://github.com/adobe/helix-html-pipeline/compare/v1.0.3...v1.0.4) (2022-03-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * no special headers init for PipelineResponse ([#9](https://github.com/adobe/helix-html-pipeline/issues/9)) ([7288677](https://github.com/adobe/helix-html-pipeline/commit/72886779f6ba0f8d07ea14757a8097034262e215))
7
+
1
8
  ## [1.0.3](https://github.com/adobe/helix-html-pipeline/compare/v1.0.2...v1.0.3) (2022-03-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -19,7 +19,7 @@ export class PipelineResponse {
19
19
  * Creates the pipeline response
20
20
  */
21
21
  constructor(body = undefined, init = {}) {
22
- let headers = init.headers ?? new Map([['content-type', 'text/html; charset=utf-8']]);
22
+ let headers = init.headers ?? new Map();
23
23
  if (typeof headers.get !== 'function') {
24
24
  headers = new Map(Object.entries(init.headers));
25
25
  }
package/src/html-pipe.js CHANGED
@@ -54,7 +54,11 @@ export async function htmlPipe(state, req) {
54
54
  }
55
55
 
56
56
  /** @type PipelineResponse */
57
- const res = new PipelineResponse();
57
+ const res = new PipelineResponse('', {
58
+ headers: {
59
+ 'content-type': 'text/html; charset=utf-8',
60
+ },
61
+ });
58
62
 
59
63
  try { // fetch config first, since we need to compute the content-bus-id from the fstab ...
60
64
  await fetchConfig(state, req, res);
package/src/index.js CHANGED
@@ -16,3 +16,8 @@ export * from './PipelineRequest.js';
16
16
  export * from './PipelineResponse.js';
17
17
  export * from './PipelineState.js';
18
18
  export * from './PipelineStatusError.js';
19
+
20
+ export { default as fetchMetadata } from './steps/fetch-metadata.js';
21
+ export { default as fetchConfig } from './steps/fetch-config.js';
22
+ export { default as setCustomResponseHeaders } from './steps/set-custom-response-headers.js';
23
+ export { getOriginalHost } from './steps/utils.js';