@adobe/helix-html-pipeline 5.1.0 → 5.1.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 +8 -0
- package/package.json +1 -1
- package/src/steps/fetch-content.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [5.1.1](https://github.com/adobe/helix-html-pipeline/compare/v5.1.0...v5.1.1) (2023-11-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* append .plain.html in redirects if needed ([#452](https://github.com/adobe/helix-html-pipeline/issues/452)) ([d3035a1](https://github.com/adobe/helix-html-pipeline/commit/d3035a1f593b0ac39fd9bd2ce68c8bcb83fe06b4)), closes [#451](https://github.com/adobe/helix-html-pipeline/issues/451)
|
|
7
|
+
* increase test time ([336bda0](https://github.com/adobe/helix-html-pipeline/commit/336bda099dae3a3faea26c71984693a2cd3a998f))
|
|
8
|
+
|
|
1
9
|
# [5.1.0](https://github.com/adobe/helix-html-pipeline/compare/v5.0.12...v5.1.0) (2023-11-06)
|
|
2
10
|
|
|
3
11
|
|
package/package.json
CHANGED
|
@@ -37,10 +37,13 @@ export default async function fetchContent(state, req, res) {
|
|
|
37
37
|
const ret = await state.s3Loader.getObject(bucketId, key);
|
|
38
38
|
|
|
39
39
|
// check for redirect
|
|
40
|
-
|
|
40
|
+
let redirectLocation = ret.headers.get('x-amz-meta-redirect-location');
|
|
41
41
|
if (redirectLocation) {
|
|
42
42
|
res.status = 301;
|
|
43
43
|
res.body = '';
|
|
44
|
+
if (redirectLocation.startsWith('/') && state.info.selector === 'plain') {
|
|
45
|
+
redirectLocation += '.plain.html';
|
|
46
|
+
}
|
|
44
47
|
res.headers.set('location', redirectLocation);
|
|
45
48
|
res.headers.set('x-surrogate-key', await computeSurrogateKey(`${contentBusId}${info.path}`));
|
|
46
49
|
res.error = 'moved';
|