MCPcopy Create free account
hub / github.com/Effect-TS/effect / onRequestUpgrade

Function onRequestUpgrade

packages/platform/node/src/NodeHttpClient.ts:288–294  ·  view source on GitHub ↗
(_, statusCode, headers, socket)

Source from the content-addressed store, hash-verified

286 if (reason !== undefined) c.abort(reason)
287 },
288 onRequestUpgrade(_, statusCode, headers, socket) {
289 done()
290 const body = new UpgradeResponseBody(undefined)
291 body.push(null)
292 // undici has already pushed back the bytes past the response head
293 resume(Effect.succeed({ statusCode, headers, body, upgraded: takeOver(socket, undefined, signal) }))
294 },
295 onResponseStart(c, statusCode, headers) {
296 if (statusCode < 200) return
297 body = new UpgradeResponseBody(c)

Callers

nothing calls this directly

Calls 5

doneFunction · 0.70
takeOverFunction · 0.70
pushMethod · 0.65
resumeFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected