@adobe/helix-html-pipeline 1.1.0 → 1.1.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 +22 -0
- package/package.json +6 -6
- package/src/html-pipe.js +7 -0
- package/src/steps/set-x-surrogate-key-header.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [1.1.3](https://github.com/adobe/helix-html-pipeline/compare/v1.1.2...v1.1.3) (2022-03-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update dependency @adobe/helix-shared-utils to v2.0.5 ([4ea15f9](https://github.com/adobe/helix-html-pipeline/commit/4ea15f9888486ba0e81e92c7796236726da5b74c))
|
|
7
|
+
|
|
8
|
+
## [1.1.2](https://github.com/adobe/helix-html-pipeline/compare/v1.1.1...v1.1.2) (2022-03-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* handling invalid input url with 400 ([#16](https://github.com/adobe/helix-html-pipeline/issues/16)) ([4491691](https://github.com/adobe/helix-html-pipeline/commit/449169107cc1d6a3b7b5fd211b39174d59fb2a8e)), closes [#15](https://github.com/adobe/helix-html-pipeline/issues/15)
|
|
14
|
+
|
|
15
|
+
## [1.1.1](https://github.com/adobe/helix-html-pipeline/compare/v1.1.0...v1.1.1) (2022-03-10)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* adapt to breaking change (computeSurrogateKey is async) ([9c8830d](https://github.com/adobe/helix-html-pipeline/commit/9c8830dc8db3007921dd85f27537c030d80c0cbf))
|
|
21
|
+
* **deps:** update dependency @adobe/helix-shared-utils to v2.0.4 ([b5cd927](https://github.com/adobe/helix-html-pipeline/commit/b5cd92783f03c47f7f26fbaa6c9438ea11c1e05b))
|
|
22
|
+
|
|
1
23
|
# [1.1.0](https://github.com/adobe/helix-html-pipeline/compare/v1.0.5...v1.1.0) (2022-03-10)
|
|
2
24
|
|
|
3
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@adobe/helix-markdown-support": "3.1.2",
|
|
36
|
-
"@adobe/helix-shared-utils": "2.0.
|
|
36
|
+
"@adobe/helix-shared-utils": "2.0.5",
|
|
37
37
|
"github-slugger": "1.4.0",
|
|
38
38
|
"hast-util-to-html": "8.0.3",
|
|
39
39
|
"jsdom": "19.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"property-information": "6.1.1",
|
|
54
54
|
"remark-parse": "10.0.1",
|
|
55
55
|
"strip-markdown": "5.0.0",
|
|
56
|
-
"unified": "10.1.
|
|
56
|
+
"unified": "10.1.2",
|
|
57
57
|
"unist-util-map": "3.0.0",
|
|
58
58
|
"unist-util-remove-position": "4.0.1",
|
|
59
59
|
"unist-util-select": "4.0.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@adobe/eslint-config-helix": "1.3.2",
|
|
65
|
-
"@markedjs/html-differ": "4.0.
|
|
65
|
+
"@markedjs/html-differ": "4.0.1",
|
|
66
66
|
"@semantic-release/changelog": "6.0.1",
|
|
67
67
|
"@semantic-release/git": "10.0.1",
|
|
68
68
|
"@semantic-release/npm": "9.0.1",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"codecov": "3.8.3",
|
|
72
72
|
"commitizen": "4.2.4",
|
|
73
73
|
"cz-conventional-changelog": "3.3.0",
|
|
74
|
-
"eslint": "8.
|
|
74
|
+
"eslint": "8.11.0",
|
|
75
75
|
"eslint-plugin-header": "3.1.1",
|
|
76
76
|
"eslint-plugin-import": "2.25.4",
|
|
77
77
|
"esmock": "1.7.4",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"jsdoc-to-markdown": "7.1.1",
|
|
83
83
|
"junit-report-builder": "3.0.0",
|
|
84
84
|
"lint-staged": "12.3.5",
|
|
85
|
-
"mocha": "9.2.
|
|
85
|
+
"mocha": "9.2.2",
|
|
86
86
|
"mocha-multi-reporters": "1.5.1",
|
|
87
87
|
"remark-gfm": "3.0.1",
|
|
88
88
|
"semantic-release": "19.0.2",
|
package/src/html-pipe.js
CHANGED
|
@@ -110,6 +110,13 @@ export async function htmlPipe(state, req) {
|
|
|
110
110
|
}
|
|
111
111
|
log.error(`error running pipeline: ${res.status} ${res.error}`, e);
|
|
112
112
|
res.headers.set('x-error', cleanupHeaderValue(res.error));
|
|
113
|
+
|
|
114
|
+
// turn any URL errors into a 400, since they are user input
|
|
115
|
+
// see https://github.com/adobe/helix-pipeline-service/issues/346
|
|
116
|
+
if (e.code === 'ERR_INVALID_URL') {
|
|
117
|
+
res.status = 400;
|
|
118
|
+
res.headers.set('x-error', cleanupHeaderValue(`invalid url: ${e.input}`));
|
|
119
|
+
}
|
|
113
120
|
}
|
|
114
121
|
|
|
115
122
|
return res;
|
|
@@ -18,14 +18,14 @@ import { computeSurrogateKey } from '@adobe/helix-shared-utils';
|
|
|
18
18
|
* @param {PipelineResponse} res
|
|
19
19
|
* @returns {Promise<void>}
|
|
20
20
|
*/
|
|
21
|
-
export default function setXSurrogateKeyHeader(state, req, res) {
|
|
21
|
+
export default async function setXSurrogateKeyHeader(state, req, res) {
|
|
22
22
|
const {
|
|
23
23
|
content, contentBusId, info, owner, repo, ref,
|
|
24
24
|
} = state;
|
|
25
25
|
|
|
26
26
|
const keys = [];
|
|
27
27
|
if (content.sourceLocation) {
|
|
28
|
-
keys.push(computeSurrogateKey(content.sourceLocation));
|
|
28
|
+
keys.push(await computeSurrogateKey(content.sourceLocation));
|
|
29
29
|
}
|
|
30
30
|
if (info.selector !== 'plain') {
|
|
31
31
|
keys.push(`${contentBusId}_metadata`);
|