GeezerVison is showing github.com — doc: update http2's `push` and `trailers` events with `rawHeaders` param · nodejs/node@fd9e14c
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/http2.md +6-4Lines changed: 6 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1338,10 +1338,11 @@ added: v8.4.0 |
1338 | 1338 |
|
1339 | 1339 | * `headers` {HTTP/2 Headers Object} An object describing the headers |
1340 | 1340 | * `flags` {number} The associated numeric flags |
| 1341 | +* `rawHeaders` {HTTP/2 Raw Headers} |
1341 | 1342 |
|
1342 | 1343 | The `'trailers'` event is emitted when a block of headers associated with |
1343 | | -trailing header fields is received. The listener callback is passed the |
1344 | | -[HTTP/2 Headers Object][] and flags associated with the headers. |
| 1344 | +trailing header fields is received. The listener callback is passed the [HTTP/2 Headers Object][], flags associated |
| 1345 | +with the headers, and the headers in raw format (see [HTTP/2 Raw Headers][]). |
1345 | 1346 |
|
1346 | 1347 | This event might not be emitted if `http2stream.end()` is called |
1347 | 1348 | before trailers are received and the incoming data is not being read or |
@@ -1695,10 +1696,11 @@ added: v8.4.0 |
1695 | 1696 |
|
1696 | 1697 | * `headers` {HTTP/2 Headers Object} |
1697 | 1698 | * `flags` {number} |
| 1699 | +* `rawHeaders` {HTTP/2 Raw Headers} |
1698 | 1700 |
|
1699 | 1701 | The `'push'` event is emitted when response headers for a Server Push stream |
1700 | | -are received. The listener callback is passed the [HTTP/2 Headers Object][] and |
1701 | | -flags associated with the headers. |
| 1702 | +are received. The listener callback is passed the [HTTP/2 Headers Object][], flags associated |
| 1703 | +with the headers, and the headers in raw format (see [HTTP/2 Raw Headers][]). |
1702 | 1704 |
|
1703 | 1705 | ```js |
1704 | 1706 | stream.on('push', (headers, flags) => { |
|