Skip to content

stream: pipeline should use req.abort() to destroy response

destroy(err) on http response will propagate the error to the request causing 'error' to be unexpectedly emitted. Furthermore, response.destroy() unlike request.abort() does not _dump buffered data.

Fixes a breaking change applied in https://github.com/nodejs/node/commit/648088289d619bfb149fe90316ce0127083c4c99.

Prefer res.req.abort() over res.destroy() until this situation is clarified.

This is a bugfix and I believe it should be semver minor.

Fixes https://github.com/nodejs/node/issues/31029.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading