Commit bf72384
authored
feat(ext/node): buffer Network.* bodies for inspector body-fetch commands (#34201)
The Node-style inspector Network domain shipped in #32707 plumbed event
broadcast for Network.dataReceived / dataSent / requestWillBeSent /
responseReceived, but the three CDP commands consumers actually use to
pull bodies back out — Network.getResponseBody,
Network.streamResourceContent, and Network.getRequestPostData — weren't
implemented, so any tool that called them got a -32601 method-not-found
error.
This adds a bounded per-process buffer (32 requests max, 10 MB per
request, FIFO eviction) on the inspector that captures bodies as the
events flow through op_inspector_emit_protocol_event, plus dispatcher
handlers for the three commands on both the local-session and WebSocket
paths. Charset handling mirrors Node: utf-8 returns a decoded string,
anything else returns base64. Raw Buffer/Uint8Array data passed to
inspector.Network.dataReceived/.dataSent is base64-encoded at the
polyfill layer to match the wire format consumers expect.
Clears four node_compat tests:
test-inspector-network-data-received.js,
test-inspector-network-data-sent.js,
test-inspector-network-arbitrary-data.js, and
test-inspector-emit-protocol-event.js1 parent 9847847 commit bf72384
6 files changed
Lines changed: 504 additions & 52 deletions
File tree
- ext/node
- ops
- polyfills
- libs/core
- tests/node_compat
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
121 | 130 | | |
122 | | - | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| |||
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
150 | | - | |
151 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
152 | 169 | | |
153 | 170 | | |
154 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
62 | 90 | | |
63 | 91 | | |
64 | 92 | | |
| |||
247 | 275 | | |
248 | 276 | | |
249 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
250 | 288 | | |
251 | 289 | | |
252 | 290 | | |
| |||
256 | 294 | | |
257 | 295 | | |
258 | 296 | | |
259 | | - | |
260 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
261 | 300 | | |
262 | 301 | | |
263 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments