(req, options)
| 202 | } |
| 203 | |
| 204 | function 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 | } |
| 243 | ObjectSetPrototypeOf(ServerResponse.prototype, OutgoingMessage.prototype); |
| 244 | ObjectSetPrototypeOf(ServerResponse, OutgoingMessage); |
| 245 |
nothing calls this directly
no test coverage detected
searching dependent graphs…