Skip to content

Commit

Permalink
http2: respect inspect() depth
Browse files Browse the repository at this point in the history
This commit causes Http2Stream and Http2Session to account
for inspect() depth.

PR-URL: #27983
Fixes: #27976
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
cjihrig authored and targos committed Jun 2, 2019
1 parent 8b38dfb commit 799aeca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,9 @@ class Http2Session extends EventEmitter {
}

[kInspect](depth, opts) {
if (typeof depth === 'number' && depth < 0)
return this;

const obj = {
type: this[kType],
closed: this.closed,
Expand Down Expand Up @@ -1649,6 +1652,9 @@ class Http2Stream extends Duplex {
}

[kInspect](depth, opts) {
if (typeof depth === 'number' && depth < 0)
return this;

const obj = {
id: this[kID] || '<pending>',
closed: this.closed,
Expand Down

0 comments on commit 799aeca

Please sign in to comment.