@adobe/helix-html-pipeline 3.7.7 → 3.7.8

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
+ ## [3.7.8](https://github.com/adobe/helix-html-pipeline/compare/v3.7.7...v3.7.8) (2022-12-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * handle cloudflare url error gracefully (issue [#216](https://github.com/adobe/helix-html-pipeline/issues/216)) ([3d7e5fb](https://github.com/adobe/helix-html-pipeline/commit/3d7e5fb6dea06737c3d4f70b816c8bf70df8b2cd))
7
+
1
8
  ## [3.7.7](https://github.com/adobe/helix-html-pipeline/compare/v3.7.6...v3.7.7) (2022-12-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "3.7.7",
3
+ "version": "3.7.8",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
package/src/html-pipe.js CHANGED
@@ -144,7 +144,9 @@ export async function htmlPipe(state, req) {
144
144
 
145
145
  // turn any URL errors into a 400, since they are user input
146
146
  // see https://github.com/adobe/helix-pipeline-service/issues/346
147
- if (e.code === 'ERR_INVALID_URL') {
147
+ if (e.code === 'ERR_INVALID_URL' // node runtime
148
+ /* c8 ignore next */
149
+ || (e instanceof TypeError && e.message === 'Invalid URL string.')) { // cloudflare runtime
148
150
  res.status = 400;
149
151
  res.headers.set('x-error', cleanupHeaderValue(`invalid url: ${e.input}`));
150
152
  }