MCPcopy Index your code
hub / github.com/nodejs/node / ServerResponse

Function ServerResponse

lib/_http_server.js:204–242  ·  view source on GitHub ↗
(req, options)

Source from the content-addressed store, hash-verified

202}
203
204function ServerResponse(req, options) {
205 OutgoingMessage.call(this, options);
206
207 if (req.method === 'HEAD') this._hasBody = false;
208
209 this.req = req;
210 this.sendDate = true;
211 this._sent100 = false;
212 this._expect_continue = false;
213
214 if (req.httpVersionMajor < 1 || req.httpVersionMinor < 1) {
215 this.useChunkedEncodingByDefault = chunkExpression.test(req.headers.te);
216 this.shouldKeepAlive = false;
217 }
218
219 if (hasObserver('http')) {
220 startPerf(this, kServerResponseStatistics, {
221 type: 'http',
222 name: 'HttpRequest',
223 detail: {
224 req: {
225 method: req.method,
226 url: req.url,
227 headers: req.headers,
228 },
229 },
230 });
231 }
232 if (isTraceHTTPEnabled()) {
233 this._traceEventId = getNextTraceEventId();
234 traceBegin(HTTP_SERVER_TRACE_EVENT_NAME, this._traceEventId);
235 }
236 if (onResponseCreatedChannel.hasSubscribers) {
237 onResponseCreatedChannel.publish({
238 request: req,
239 response: this,
240 });
241 }
242}
243ObjectSetPrototypeOf(ServerResponse.prototype, OutgoingMessage.prototype);
244ObjectSetPrototypeOf(ServerResponse, OutgoingMessage);
245

Callers

nothing calls this directly

Calls 8

hasObserverFunction · 0.85
startPerfFunction · 0.85
isTraceHTTPEnabledFunction · 0.85
getNextTraceEventIdFunction · 0.85
traceBeginFunction · 0.85
callMethod · 0.45
testMethod · 0.45
publishMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…