diff --git a/lib/resolver.content.js b/lib/resolver.content.js index 1c6fa871..1da6e235 100644 --- a/lib/resolver.content.js +++ b/lib/resolver.content.js @@ -166,6 +166,8 @@ export default class PodletClientContentResolver { }, }; + // Body must be consumed; https://github.com/nodejs/undici/issues/583#issuecomment-855384858 + await body.text(); throw new Boom(errorMessage, errorOptions); } if (resError) { @@ -186,7 +188,10 @@ export default class PodletClientContentResolver { js: utils.filterAssets("fallback", outgoing.manifest.js), css: utils.filterAssets("fallback", outgoing.manifest.css), }), - ); + ); + + // Body must be consumed; https://github.com/nodejs/undici/issues/583#issuecomment-855384858 + await body.text(); return outgoing; } @@ -211,7 +216,7 @@ export default class PodletClientContentResolver { this.#log.info( `podlet version number in header differs from cached version number - aborting request to remote resource for content - resource: ${outgoing.name} - url: ${outgoing.contentUri}`, ); - // TODO r.abort(); + outgoing.status = 'stale'; return outgoing; } diff --git a/lib/resolver.fallback.js b/lib/resolver.fallback.js index c3880ada..da77f5c1 100644 --- a/lib/resolver.fallback.js +++ b/lib/resolver.fallback.js @@ -113,6 +113,9 @@ export default class PodletClientFallbackResolver { ); outgoing.fallback = ''; + + // Body must be consumed; https://github.com/nodejs/undici/issues/583#issuecomment-855384858 + await body.text(); return outgoing; } diff --git a/lib/resolver.manifest.js b/lib/resolver.manifest.js index 0ef8ad08..6ca9231f 100644 --- a/lib/resolver.manifest.js +++ b/lib/resolver.manifest.js @@ -99,6 +99,9 @@ export default class PodletClientManifestResolver { this.#log.warn( `remote resource responded with non 200 http status code for manifest - code: ${statusCode} - resource: ${outgoing.name} - url: ${outgoing.manifestUri}`, ); + + // Body must be consumed; https://github.com/nodejs/undici/issues/583#issuecomment-855384858 + await body.text(); return outgoing; }