@@ -239,7 +239,7 @@ function _storeHeader(firstLine, headers) {
239
239
this . upgrading = true ;
240
240
241
241
// Date header
242
- if ( this . sendDate === true && state . sentDateHeader === false ) {
242
+ if ( this . sendDate && ! state . sentDateHeader ) {
243
243
state . messageHeader += 'Date: ' + utcDate ( ) + CRLF ;
244
244
}
245
245
@@ -255,8 +255,7 @@ function _storeHeader(firstLine, headers) {
255
255
// of creating security liabilities, so suppress the zero chunk and force
256
256
// the connection to close.
257
257
var statusCode = this . statusCode ;
258
- if ( ( statusCode === 204 || statusCode === 304 ) &&
259
- this . chunkedEncoding === true ) {
258
+ if ( ( statusCode === 204 || statusCode === 304 ) && this . chunkedEncoding ) {
260
259
debug ( statusCode + ' response should not use chunked encoding,' +
261
260
' closing connection.' ) ;
262
261
this . chunkedEncoding = false ;
@@ -267,7 +266,7 @@ function _storeHeader(firstLine, headers) {
267
266
if ( this . _removedHeader . connection ) {
268
267
this . _last = true ;
269
268
this . shouldKeepAlive = false ;
270
- } else if ( state . sentConnectionHeader === false ) {
269
+ } else if ( ! state . sentConnectionHeader ) {
271
270
var shouldSendKeepAlive = this . shouldKeepAlive &&
272
271
( state . sentContentLengthHeader ||
273
272
this . useChunkedEncodingByDefault ||
@@ -280,8 +279,7 @@ function _storeHeader(firstLine, headers) {
280
279
}
281
280
}
282
281
283
- if ( state . sentContentLengthHeader === false &&
284
- state . sentTransferEncodingHeader === false ) {
282
+ if ( ! state . sentContentLengthHeader && ! state . sentTransferEncodingHeader ) {
285
283
if ( ! this . _hasBody ) {
286
284
// Make sure we don't end the 0\r\n\r\n at the end of the message.
287
285
this . chunkedEncoding = false ;
0 commit comments