|
@ -88,6 +88,8 @@ function ServerResponse(req) { |
|
|
if (req.method === 'HEAD') this._hasBody = false; |
|
|
if (req.method === 'HEAD') this._hasBody = false; |
|
|
|
|
|
|
|
|
this.sendDate = true; |
|
|
this.sendDate = true; |
|
|
|
|
|
this._sent100 = false; |
|
|
|
|
|
this._expect_continue = false; |
|
|
|
|
|
|
|
|
if (req.httpVersionMajor < 1 || req.httpVersionMinor < 1) { |
|
|
if (req.httpVersionMajor < 1 || req.httpVersionMinor < 1) { |
|
|
this.useChunkedEncodingByDefault = chunkExpression.test(req.headers.te); |
|
|
this.useChunkedEncodingByDefault = chunkExpression.test(req.headers.te); |
|
@ -195,8 +197,7 @@ function writeHead(statusCode, reason, obj) { |
|
|
if (common._checkInvalidHeaderChar(this.statusMessage)) |
|
|
if (common._checkInvalidHeaderChar(this.statusMessage)) |
|
|
throw new Error('Invalid character in statusMessage.'); |
|
|
throw new Error('Invalid character in statusMessage.'); |
|
|
|
|
|
|
|
|
var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' + |
|
|
var statusLine = 'HTTP/1.1 ' + statusCode + ' ' + this.statusMessage + CRLF; |
|
|
this.statusMessage + CRLF; |
|
|
|
|
|
|
|
|
|
|
|
if (statusCode === 204 || statusCode === 304 || |
|
|
if (statusCode === 204 || statusCode === 304 || |
|
|
(100 <= statusCode && statusCode <= 199)) { |
|
|
(100 <= statusCode && statusCode <= 199)) { |
|
@ -232,7 +233,7 @@ function Server(requestListener) { |
|
|
net.Server.call(this, { allowHalfOpen: true }); |
|
|
net.Server.call(this, { allowHalfOpen: true }); |
|
|
|
|
|
|
|
|
if (requestListener) { |
|
|
if (requestListener) { |
|
|
this.addListener('request', requestListener); |
|
|
this.on('request', requestListener); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* eslint-disable max-len */ |
|
|
/* eslint-disable max-len */ |
|
@ -242,7 +243,7 @@ function Server(requestListener) { |
|
|
/* eslint-enable max-len */ |
|
|
/* eslint-enable max-len */ |
|
|
this.httpAllowHalfOpen = false; |
|
|
this.httpAllowHalfOpen = false; |
|
|
|
|
|
|
|
|
this.addListener('connection', connectionListener); |
|
|
this.on('connection', connectionListener); |
|
|
|
|
|
|
|
|
this.timeout = 2 * 60 * 1000; |
|
|
this.timeout = 2 * 60 * 1000; |
|
|
|
|
|
|
|
|