Skip to content

Commit 799aeca

Browse files
cjihrigtargos
authored andcommitted
http2: respect inspect() depth
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]>
1 parent 8b38dfb commit 799aeca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/internal/http2/core.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@ class Http2Session extends EventEmitter {
10731073
}
10741074

10751075
[kInspect](depth, opts) {
1076+
if (typeof depth === 'number' && depth < 0)
1077+
return this;
1078+
10761079
const obj = {
10771080
type: this[kType],
10781081
closed: this.closed,
@@ -1649,6 +1652,9 @@ class Http2Stream extends Duplex {
16491652
}
16501653

16511654
[kInspect](depth, opts) {
1655+
if (typeof depth === 'number' && depth < 0)
1656+
return this;
1657+
16521658
const obj = {
16531659
id: this[kID] || '<pending>',
16541660
closed: this.closed,

0 commit comments

Comments
 (0)