Commit 32b641e
http: fixed socket.setEncoding fatal error
Applied updates from previous pull-requests to disallow
socket.setEncoding before a http connection is parsed.
Wrapped `socket.setEncoding` to throw an error.
This previously resulted in a fatal error.
PR-URL: #33405
Fixes: #18118
Refs: #18178
Refs: #19344
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>1 parent 10596b6 commit 32b641eCopy full SHA for 32b641e
File tree
Expand file treeCollapse file tree
4 files changed
+43
-0
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- internal
- test/parallel
Expand file treeCollapse file tree
4 files changed
+43
-0
lines changedOpen diff view settings
Collapse file
+6Lines changed: 6 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
943 | 943 | |
944 | 944 | |
945 | 945 | |
| 946 | + |
| 947 | + |
| 948 | + |
| 949 | + |
| 950 | + |
946 | 951 | |
947 | 952 | |
948 | 953 | |
| ||
2613 | 2618 | |
2614 | 2619 | |
2615 | 2620 | |
| 2621 | + |
2616 | 2622 | |
2617 | 2623 | |
2618 | 2624 | |
|
Collapse file
+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
63 | 63 | |
64 | 64 | |
65 | 65 | |
| 66 | + |
66 | 67 | |
67 | 68 | |
68 | 69 | |
| ||
476 | 477 | |
477 | 478 | |
478 | 479 | |
| 480 | + |
479 | 481 | |
480 | 482 | |
481 | 483 | |
| ||
493 | 495 | |
494 | 496 | |
495 | 497 | |
| 498 | + |
| 499 | + |
| 500 | + |
| 501 | + |
496 | 502 | |
497 | 503 | |
498 | 504 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
935 | 935 | |
936 | 936 | |
937 | 937 | |
| 938 | + |
| 939 | + |
938 | 940 | |
939 | 941 | |
940 | 942 | |
|
Collapse file
test/parallel/test-http-socket-encoding-error.js
Copy file name to clipboard+29Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
0 commit comments