@adobe/helix-html-pipeline 6.4.0 → 6.4.1
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 +1 -1
- package/src/sitemap-pipe.js +5 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [6.4.1](https://github.com/adobe/helix-html-pipeline/compare/v6.4.0...v6.4.1) (2024-02-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* use correct partition ([#534](https://github.com/adobe/helix-html-pipeline/issues/534)) ([960256e](https://github.com/adobe/helix-html-pipeline/commit/960256eb6dd4045775ccf3203aa6b324558909d0))
|
|
7
|
+
|
|
1
8
|
# [6.4.0](https://github.com/adobe/helix-html-pipeline/compare/v6.3.4...v6.4.0) (2024-02-06)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/sitemap-pipe.js
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import escape from 'lodash.escape';
|
|
13
13
|
import { cleanupHeaderValue } from '@adobe/helix-shared-utils';
|
|
14
|
-
import { authenticate } from './steps/authenticate.js';
|
|
15
14
|
import fetchContent from './steps/fetch-content.js';
|
|
16
15
|
import renderCode from './steps/render-code.js';
|
|
17
16
|
import setXSurrogateKeyHeader from './steps/set-x-surrogate-key-header.js';
|
|
@@ -21,9 +20,9 @@ import { PipelineResponse } from './PipelineResponse.js';
|
|
|
21
20
|
import initConfig from './steps/init-config.js';
|
|
22
21
|
import { extractLastModified, updateLastModified } from './utils/last-modified.js';
|
|
23
22
|
|
|
24
|
-
async function generateSitemap(state
|
|
23
|
+
async function generateSitemap(state) {
|
|
25
24
|
const {
|
|
26
|
-
owner, repo, ref, contentBusId, s3Loader, log,
|
|
25
|
+
owner, repo, ref, contentBusId, s3Loader, log, partition,
|
|
27
26
|
previewHost, liveHost, prodHost,
|
|
28
27
|
} = state;
|
|
29
28
|
const ret = await s3Loader.getObject('helix-content-bus', `${contentBusId}/live/sitemap.json`);
|
|
@@ -75,12 +74,9 @@ async function generateSitemap(state, partition) {
|
|
|
75
74
|
* @returns {PipelineResponse}
|
|
76
75
|
*/
|
|
77
76
|
export async function sitemapPipe(state, req) {
|
|
78
|
-
const {
|
|
77
|
+
const { log } = state;
|
|
79
78
|
state.type = 'sitemap';
|
|
80
79
|
|
|
81
|
-
// force loading from preview
|
|
82
|
-
state.partition = 'preview';
|
|
83
|
-
|
|
84
80
|
if (state.info?.path !== '/sitemap.xml') {
|
|
85
81
|
// this should not happen as it would mean that the caller used the wrong route. so we respond
|
|
86
82
|
// with a 500 to indicate that something is wrong.
|
|
@@ -102,18 +98,11 @@ export async function sitemapPipe(state, req) {
|
|
|
102
98
|
try {
|
|
103
99
|
await initConfig(state, req, res);
|
|
104
100
|
|
|
105
|
-
// await requireProject(state, req, res);
|
|
106
|
-
if (res.error !== 401) {
|
|
107
|
-
await authenticate(state, req, res);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// ...and apply the folder mapping
|
|
111
|
-
state.timer?.update('content-fetch');
|
|
112
|
-
|
|
113
101
|
// fetch sitemap.xml
|
|
102
|
+
state.timer?.update('content-fetch');
|
|
114
103
|
await fetchContent(state, req, res);
|
|
115
104
|
if (res.status === 404) {
|
|
116
|
-
const ret = await generateSitemap(state
|
|
105
|
+
const ret = await generateSitemap(state);
|
|
117
106
|
if (ret.status === 200) {
|
|
118
107
|
res.status = 200;
|
|
119
108
|
updateLastModified(state, res, extractLastModified(ret.headers));
|