@adobe/helix-html-pipeline 1.0.1 → 1.0.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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.0.2](https://github.com/adobe/helix-html-pipeline/compare/v1.0.1...v1.0.2) (2022-03-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * canonical url and 404.html response ([9f4e473](https://github.com/adobe/helix-html-pipeline/commit/9f4e47372d6aea1252f179ad661b0d2fb03429bd))
7
+
1
8
  ## [1.0.1](https://github.com/adobe/helix-html-pipeline/compare/v1.0.0...v1.0.1) (2022-03-07)
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.1",
3
+ "version": "1.0.2",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -233,7 +233,8 @@ export default function extractMetaData(state, req) {
233
233
  });
234
234
  meta.description = `${desc.slice(0, 25).join(' ')}${desc.length > 25 ? ' ...' : ''}`;
235
235
  }
236
- meta.url = makeCanonicalHtmlUrl(getAbsoluteUrl(req.headers, req.url.href));
236
+ // use the req.url and not the state.info.path in case of folder mapping
237
+ meta.url = makeCanonicalHtmlUrl(getAbsoluteUrl(req.headers, req.url.pathname));
237
238
  if (!meta.canonical) {
238
239
  meta.canonical = meta.url;
239
240
  }
@@ -74,7 +74,7 @@ export default async function fetchContent(state, req, res) {
74
74
  }
75
75
 
76
76
  // keep 404 response status
77
- res.body = ret.body;
77
+ res.body = ret404.body;
78
78
  res.headers.set('last-modified', ret404.headers.get('last-modified'));
79
79
  res.headers.set('content-type', 'text/html; charset=utf-8');
80
80
  res.headers.set('x-surrogate-key', `${ref}--${repo}--${owner}_404`);