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 <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
cjihrig committed Jun 1, 2019
1 parent 2983eac commit f86100c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/http2/core.js
Expand Up @@ -1069,6 +1069,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 @@ -1645,6 +1648,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 f86100c

Please sign in to comment.