@adobe/helix-html-pipeline 5.5.1 → 5.5.2
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 +7 -0
- package/package.json +2 -2
- package/src/sitemap-pipe.js +8 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [5.5.2](https://github.com/adobe/helix-html-pipeline/compare/v5.5.1...v5.5.2) (2024-01-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* include surrogate keys for 404 sitemap.xml ([#513](https://github.com/adobe/helix-html-pipeline/issues/513)) ([d81798f](https://github.com/adobe/helix-html-pipeline/commit/d81798f096f6fded11f3280c0c53e4806d2bf5ee))
|
|
7
|
+
|
|
1
8
|
## [5.5.1](https://github.com/adobe/helix-html-pipeline/compare/v5.5.0...v5.5.1) (2024-01-23)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.2",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@adobe/helix-markdown-support": "7.1.0",
|
|
46
|
-
"@adobe/helix-shared-utils": "3.0.
|
|
46
|
+
"@adobe/helix-shared-utils": "3.0.1",
|
|
47
47
|
"@adobe/mdast-util-gridtables": "3.0.2",
|
|
48
48
|
"@adobe/remark-gridtables": "2.0.2",
|
|
49
49
|
"cookie": "0.6.0",
|
package/src/sitemap-pipe.js
CHANGED
|
@@ -51,7 +51,7 @@ export async function sitemapPipe(state, req) {
|
|
|
51
51
|
/** @type PipelineResponse */
|
|
52
52
|
const res = new PipelineResponse('', {
|
|
53
53
|
headers: {
|
|
54
|
-
'content-type': 'text/
|
|
54
|
+
'content-type': 'text/plain; charset=utf-8',
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
57
|
|
|
@@ -81,13 +81,7 @@ export async function sitemapPipe(state, req) {
|
|
|
81
81
|
|
|
82
82
|
if (res.error) {
|
|
83
83
|
// if content loading produced an error, we're done.
|
|
84
|
-
|
|
85
|
-
log[level](`pipeline status: ${res.status} ${res.error}`);
|
|
86
|
-
res.headers.set('x-error', cleanupHeaderValue(res.error));
|
|
87
|
-
if (res.status < 500) {
|
|
88
|
-
await setCustomResponseHeaders(state, req, res);
|
|
89
|
-
}
|
|
90
|
-
return res;
|
|
84
|
+
throw new PipelineStatusError(res.status, res.error);
|
|
91
85
|
}
|
|
92
86
|
|
|
93
87
|
state.timer?.update('serialize');
|
|
@@ -96,16 +90,15 @@ export async function sitemapPipe(state, req) {
|
|
|
96
90
|
await setXSurrogateKeyHeader(state, req, res);
|
|
97
91
|
} catch (e) {
|
|
98
92
|
res.error = e.message;
|
|
99
|
-
|
|
100
|
-
res.status = e.code;
|
|
101
|
-
} else {
|
|
102
|
-
res.status = 500;
|
|
103
|
-
}
|
|
93
|
+
res.status = e.code || 500;
|
|
104
94
|
|
|
105
95
|
const level = res.status >= 500 ? 'error' : 'info';
|
|
106
|
-
log[level](`pipeline status: ${res.status} ${res.error}
|
|
96
|
+
log[level](`pipeline status: ${res.status} ${res.error}`);
|
|
107
97
|
res.headers.set('x-error', cleanupHeaderValue(res.error));
|
|
98
|
+
if (res.status < 500) {
|
|
99
|
+
await setCustomResponseHeaders(state, req, res);
|
|
100
|
+
await setXSurrogateKeyHeader(state, req, res);
|
|
101
|
+
}
|
|
108
102
|
}
|
|
109
|
-
|
|
110
103
|
return res;
|
|
111
104
|
}
|