MCPcopy Create free account
hub / github.com/nodejs/undici / onResponseStart

Method onResponseStart

docs/examples/proxy/proxy.js:61–73  ·  view source on GitHub ↗
(controller, statusCode)

Source from the content-addressed store, hash-verified

59 }
60
61 onResponseStart (controller, statusCode) {
62 if (statusCode < 200) {
63 return
64 }
65
66 this.resume = () => controller.resume()
67 this.res.on('drain', this.resume)
68 this.res.writeHead(statusCode, getHeaders({
69 headers: controller.rawHeaders ?? [],
70 proxyName: this.proxyName,
71 httpVersion: this.httpVersion
72 }))
73 }
74
75 onResponseData (controller, chunk) {
76 if (this.res.write(chunk) === false) {

Callers

nothing calls this directly

Calls 3

getHeadersFunction · 0.85
resumeMethod · 0.65
onMethod · 0.45

Tested by

no test coverage detected