Commit 2e77a10
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 introduced in 6480882.
Prefer res.req.abort() over res.destroy() until this situation is
clarified.
Fixes: #31029
Refs: 6480882
PR-URL: #31054
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>1 parent d73b834 commit 2e77a10Copy full SHA for 2e77a10
File tree
Expand file treeCollapse file tree
2 files changed
+39
-13
lines changedOpen diff view settings
Filter options
- lib/internal/streams
- test/parallel
Expand file treeCollapse file tree
2 files changed
+39
-13
lines changedOpen diff view settings
Collapse file
lib/internal/streams/pipeline.js
Copy file name to clipboardExpand all lines: lib/internal/streams/pipeline.js+3-12Lines changed: 3 additions & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17 | 17 | |
18 | 18 | |
19 | 19 | |
20 | | - |
| 20 | + |
21 | 21 | |
22 | 22 | |
23 | 23 | |
| ||
43 | 43 | |
44 | 44 | |
45 | 45 | |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
| 46 | + |
| 47 | + |
55 | 48 | |
56 | 49 | |
57 | 50 | |
58 | 51 | |
59 | 52 | |
60 | | - |
61 | | - |
62 | 53 | |
63 | 54 | |
64 | 55 | |
|
Collapse file
test/parallel/test-stream-pipeline.js
Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipeline.js+36-1Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
5 | 12 | |
6 | 13 | |
7 | 14 | |
| ||
483 | 490 | |
484 | 491 | |
485 | 492 | |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
| 498 | + |
| 499 | + |
| 500 | + |
| 501 | + |
| 502 | + |
| 503 | + |
| 504 | + |
| 505 | + |
| 506 | + |
| 507 | + |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
| 512 | + |
| 513 | + |
| 514 | + |
| 515 | + |
| 516 | + |
| 517 | + |
| 518 | + |
| 519 | + |
| 520 | + |
0 commit comments