From 7c82b594e1732b8c3fba3550aae7c05f80b75996 Mon Sep 17 00:00:00 2001 From: yusheng Date: Thu, 14 May 2026 08:28:14 +0800 Subject: [PATCH] doc: (http2) update push and trailers event with rawHeaders param Signed-off-by: Yu-Sheng Chen --- doc/api/http2.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index dcba89fcedec6d..1ecccb841fed81 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1341,10 +1341,11 @@ added: v8.4.0 * `headers` {HTTP/2 Headers Object} An object describing the headers * `flags` {number} The associated numeric flags +* `rawHeaders` {HTTP/2 Raw Headers} The `'trailers'` event is emitted when a block of headers associated with -trailing header fields is received. The listener callback is passed the -[HTTP/2 Headers Object][] and flags associated with the headers. +trailing header fields is received. The listener callback is passed the [HTTP/2 Headers Object][], flags associated +with the headers, and the headers in raw format (see [HTTP/2 Raw Headers][]). This event might not be emitted if `http2stream.end()` is called before trailers are received and the incoming data is not being read or @@ -1704,10 +1705,11 @@ added: v8.4.0 * `headers` {HTTP/2 Headers Object} * `flags` {number} +* `rawHeaders` {HTTP/2 Raw Headers} The `'push'` event is emitted when response headers for a Server Push stream -are received. The listener callback is passed the [HTTP/2 Headers Object][] and -flags associated with the headers. +are received. The listener callback is passed the [HTTP/2 Headers Object][], flags associated +with the headers, and the headers in raw format (see [HTTP/2 Raw Headers][]). ```js stream.on('push', (headers, flags) => {