Commit fa5a380
http2: refactor how trailers are done
Rather than an option, introduce a method and an event...
```js
server.on('stream', (stream) => {
stream.respond(undefined, { waitForTrailers: true });
stream.on('wantTrailers', () => {
stream.sendTrailers({ abc: 'xyz'});
});
stream.end('hello world');
});
```
This is a breaking change in the API such that the prior
`options.getTrailers` is no longer supported at all.
Ordinarily this would be semver-major and require a
deprecation but the http2 stuff is still experimental.
Backport-PR-URL: #22850
PR-URL: #19959
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>1 parent c0d1423 commit fa5a380Copy full SHA for fa5a380
File tree
Expand file treeCollapse file tree
17 files changed
+326
-305
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal
- http2
- src
- test/parallel
Expand file treeCollapse file tree
17 files changed
+326
-305
lines changedOpen diff view settings
Collapse file
+13Lines changed: 13 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
861 | 861 | |
862 | 862 | |
863 | 863 | |
| 864 | + |
| 865 | + |
| 866 | + |
| 867 | + |
| 868 | + |
| 869 | + |
| 870 | + |
| 871 | + |
| 872 | + |
| 873 | + |
| 874 | + |
| 875 | + |
| 876 | + |
864 | 877 | |
865 | 878 | |
866 | 879 | |
|
Collapse file
+114-78Lines changed: 114 additions & 78 deletions
- Display the source diff
- Display the rich diff
Large diffs are not rendered by default.
Collapse file
+6-2Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
341 | 341 | |
342 | 342 | |
343 | 343 | |
344 | | - |
345 | | - |
| 344 | + |
| 345 | + |
| 346 | + |
| 347 | + |
| 348 | + |
| 349 | + |
346 | 350 | |
347 | 351 | |
348 | 352 | |
|
Collapse file
lib/internal/http2/compat.js
Copy file name to clipboardExpand all lines: lib/internal/http2/compat.js+6-1Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
344 | 344 | |
345 | 345 | |
346 | 346 | |
| 347 | + |
| 348 | + |
| 349 | + |
| 350 | + |
347 | 351 | |
348 | 352 | |
349 | 353 | |
| ||
363 | 367 | |
364 | 368 | |
365 | 369 | |
| 370 | + |
366 | 371 | |
367 | 372 | |
368 | 373 | |
| ||
632 | 637 | |
633 | 638 | |
634 | 639 | |
635 | | - |
| 640 | + |
636 | 641 | |
637 | 642 | |
638 | 643 | |
|
Collapse file
+41-50Lines changed: 41 additions & 50 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
245 | 245 | |
246 | 246 | |
247 | 247 | |
248 | | - |
249 | | - |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
| 248 | + |
| 249 | + |
| 250 | + |
254 | 251 | |
255 | 252 | |
| 253 | + |
256 | 254 | |
257 | | - |
258 | | - |
259 | | - |
260 | | - |
261 | | - |
262 | | - |
263 | | - |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
264 | 259 | |
265 | | - |
266 | | - |
267 | 260 | |
268 | 261 | |
269 | 262 | |
| ||
479 | 472 | |
480 | 473 | |
481 | 474 | |
482 | | - |
| 475 | + |
483 | 476 | |
484 | | - |
485 | | - |
486 | 477 | |
487 | 478 | |
488 | 479 | |
| ||
1367 | 1358 | |
1368 | 1359 | |
1369 | 1360 | |
1370 | | - |
1371 | | - |
1372 | | - |
1373 | | - |
1374 | | - |
1375 | | - |
1376 | | - |
1377 | 1361 | |
1378 | 1362 | |
1379 | 1363 | |
| ||
1486 | 1470 | |
1487 | 1471 | |
1488 | 1472 | |
1489 | | - |
| 1473 | + |
| 1474 | + |
1490 | 1475 | |
1491 | 1476 | |
1492 | 1477 | |
| ||
1742 | 1727 | |
1743 | 1728 | |
1744 | 1729 | |
| 1730 | + |
| 1731 | + |
| 1732 | + |
| 1733 | + |
| 1734 | + |
| 1735 | + |
| 1736 | + |
| 1737 | + |
| 1738 | + |
| 1739 | + |
| 1740 | + |
| 1741 | + |
| 1742 | + |
| 1743 | + |
| 1744 | + |
| 1745 | + |
| 1746 | + |
| 1747 | + |
| 1748 | + |
| 1749 | + |
| 1750 | + |
| 1751 | + |
| 1752 | + |
| 1753 | + |
| 1754 | + |
| 1755 | + |
| 1756 | + |
1745 | 1757 | |
1746 | 1758 | |
1747 | 1759 | |
| ||
2169 | 2181 | |
2170 | 2182 | |
2171 | 2183 | |
2172 | | - |
2173 | | - |
2174 | | - |
2175 | | - |
2176 | | - |
2177 | | - |
| 2184 | + |
2178 | 2185 | |
2179 | | - |
2180 | | - |
2181 | 2186 | |
2182 | 2187 | |
2183 | 2188 | |
| ||
2243 | 2248 | |
2244 | 2249 | |
2245 | 2250 | |
2246 | | - |
2247 | | - |
2248 | | - |
2249 | | - |
2250 | | - |
2251 | | - |
| 2251 | + |
2252 | 2252 | |
2253 | | - |
2254 | | - |
2255 | 2253 | |
2256 | 2254 | |
2257 | 2255 | |
| ||
2317 | 2315 | |
2318 | 2316 | |
2319 | 2317 | |
2320 | | - |
2321 | | - |
2322 | | - |
2323 | | - |
2324 | | - |
2325 | | - |
| 2318 | + |
2326 | 2319 | |
2327 | | - |
2328 | | - |
2329 | 2320 | |
2330 | 2321 | |
2331 | 2322 | |
|
Collapse file
+40-67Lines changed: 40 additions & 67 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1117 | 1117 | |
1118 | 1118 | |
1119 | 1119 | |
1120 | | - |
1121 | | - |
1122 | | - |
1123 | | - |
1124 | | - |
1125 | | - |
1126 | | - |
1127 | | - |
1128 | | - |
1129 | | - |
1130 | | - |
1131 | | - |
1132 | | - |
1133 | | - |
1134 | | - |
1135 | | - |
1136 | | - |
1137 | | - |
1138 | | - |
1139 | | - |
1140 | | - |
1141 | | - |
1142 | | - |
1143 | | - |
1144 | | - |
1145 | | - |
1146 | | - |
1147 | | - |
1148 | | - |
1149 | | - |
1150 | 1120 | |
1151 | 1121 | |
1152 | 1122 | |
| ||
1808 | 1778 | |
1809 | 1779 | |
1810 | 1780 | |
1811 | | - |
1812 | | - |
1813 | | - |
1814 | | - |
1815 | | - |
1816 | | - |
1817 | | - |
1818 | | - |
1819 | | - |
1820 | | - |
1821 | | - |
1822 | | - |
1823 | | - |
1824 | | - |
1825 | | - |
1826 | | - |
1827 | | - |
1828 | | - |
1829 | | - |
1830 | | - |
1831 | | - |
1832 | | - |
1833 | | - |
1834 | 1781 | |
1835 | 1782 | |
1836 | 1783 | |
| ||
1952 | 1899 | |
1953 | 1900 | |
1954 | 1901 | |
| 1902 | + |
| 1903 | + |
| 1904 | + |
| 1905 | + |
| 1906 | + |
| 1907 | + |
| 1908 | + |
| 1909 | + |
| 1910 | + |
| 1911 | + |
| 1912 | + |
| 1913 | + |
| 1914 | + |
| 1915 | + |
| 1916 | + |
| 1917 | + |
| 1918 | + |
| 1919 | + |
| 1920 | + |
| 1921 | + |
1955 | 1922 | |
1956 | 1923 | |
1957 | 1924 | |
| ||
2184 | 2151 | |
2185 | 2152 | |
2186 | 2153 | |
2187 | | - |
2188 | | - |
2189 | | - |
2190 | | - |
2191 | | - |
2192 | | - |
2193 | | - |
2194 | 2154 | |
2195 | 2155 | |
2196 | 2156 | |
| ||
2258 | 2218 | |
2259 | 2219 | |
2260 | 2220 | |
2261 | | - |
2262 | | - |
2263 | | - |
2264 | | - |
2265 | | - |
2266 | | - |
2267 | | - |
| 2221 | + |
| 2222 | + |
| 2223 | + |
| 2224 | + |
2268 | 2225 | |
2269 | 2226 | |
2270 | 2227 | |
| ||
2574 | 2531 | |
2575 | 2532 | |
2576 | 2533 | |
| 2534 | + |
| 2535 | + |
| 2536 | + |
| 2537 | + |
| 2538 | + |
| 2539 | + |
| 2540 | + |
| 2541 | + |
| 2542 | + |
| 2543 | + |
| 2544 | + |
| 2545 | + |
| 2546 | + |
| 2547 | + |
| 2548 | + |
2577 | 2549 | |
2578 | 2550 | |
2579 | 2551 | |
| ||
2921 | 2893 | |
2922 | 2894 | |
2923 | 2895 | |
| 2896 | + |
2924 | 2897 | |
2925 | 2898 | |
2926 | 2899 | |
|
0 commit comments