From a4d910c644fa88716058cb83bdc0ecb9df530f69 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 8 Jan 2018 12:18:22 -0800 Subject: [PATCH] http2: remember sent headers Add sentHeaders, sentTrailers, and sentInfoHeaders properties on `Http2Stream`. Backport-PR-URL: https://github.com/nodejs/node/pull/20456 PR-URL: https://github.com/nodejs/node/pull/18045 Fixes: https://github.com/nodejs/node/issues/16619 Reviewed-By: Matteo Collina --- doc/api/http2.md | 28 ++++++++++++++ lib/internal/http2/core.js | 24 ++++++++++++ test/parallel/test-http2-sent-headers.js | 47 ++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 test/parallel/test-http2-sent-headers.js diff --git a/doc/api/http2.md b/doc/api/http2.md index e92baddf3cc695..f92aec7288d0e7 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -989,6 +989,34 @@ destroyed after either receiving an `RST_STREAM` frame from the connected peer, calling `http2stream.close()`, or `http2stream.destroy()`. Will be `undefined` if the `Http2Stream` has not been closed. +#### http2stream.sentHeaders + + +* Value: {[Headers Object][]} + +An object containing the outbound headers sent for this `Http2Stream`. + +#### http2stream.sentInfoHeaders + + +* Value: {[Headers Object][]\[\]} + +An array of objects containing the outbound informational (additional) headers +sent for this `Http2Stream`. + +#### http2stream.sentTrailers + + +* Value: {[Headers Object][]} + +An object containing the outbound trailers sent for this this `HttpStream`. + #### http2stream.session