lib: use triple equals
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
parent
08a5b442e4
commit
006d42786e
@ -386,10 +386,10 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
|
|||||||
// but *can* have a content-length which actually corresponds
|
// but *can* have a content-length which actually corresponds
|
||||||
// to the content-length of the entity-body had the request
|
// to the content-length of the entity-body had the request
|
||||||
// been a GET.
|
// been a GET.
|
||||||
var isHeadResponse = req.method == 'HEAD';
|
var isHeadResponse = req.method === 'HEAD';
|
||||||
debug('AGENT isHeadResponse', isHeadResponse);
|
debug('AGENT isHeadResponse', isHeadResponse);
|
||||||
|
|
||||||
if (res.statusCode == 100) {
|
if (res.statusCode === 100) {
|
||||||
// restart the parser, as this is a continue message.
|
// restart the parser, as this is a continue message.
|
||||||
delete req.res; // Clear res so that we don't hit double-responses.
|
delete req.res; // Clear res so that we don't hit double-responses.
|
||||||
req.emit('continue');
|
req.emit('continue');
|
||||||
|
@ -228,7 +228,7 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Date header
|
// Date header
|
||||||
if (this.sendDate == true && state.sentDateHeader == false) {
|
if (this.sendDate === true && state.sentDateHeader === false) {
|
||||||
state.messageHeader += 'Date: ' + utcDate() + CRLF;
|
state.messageHeader += 'Date: ' + utcDate() + CRLF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
|
|||||||
// of creating security liabilities, so suppress the zero chunk and force
|
// of creating security liabilities, so suppress the zero chunk and force
|
||||||
// the connection to close.
|
// the connection to close.
|
||||||
var statusCode = this.statusCode;
|
var statusCode = this.statusCode;
|
||||||
if ((statusCode == 204 || statusCode === 304) &&
|
if ((statusCode === 204 || statusCode === 304) &&
|
||||||
this.chunkedEncoding === true) {
|
this.chunkedEncoding === true) {
|
||||||
debug(statusCode + ' response should not use chunked encoding,' +
|
debug(statusCode + ' response should not use chunked encoding,' +
|
||||||
' closing connection.');
|
' closing connection.');
|
||||||
@ -269,8 +269,8 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.sentContentLengthHeader == false &&
|
if (state.sentContentLengthHeader === false &&
|
||||||
state.sentTransferEncodingHeader == false) {
|
state.sentTransferEncodingHeader === false) {
|
||||||
if (this._hasBody && !this._removedHeader['transfer-encoding']) {
|
if (this._hasBody && !this._removedHeader['transfer-encoding']) {
|
||||||
if (this.useChunkedEncodingByDefault) {
|
if (this.useChunkedEncodingByDefault) {
|
||||||
state.messageHeader += 'Transfer-Encoding: chunked\r\n';
|
state.messageHeader += 'Transfer-Encoding: chunked\r\n';
|
||||||
|
@ -156,7 +156,7 @@ ServerResponse.prototype.assignSocket = function(socket) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ServerResponse.prototype.detachSocket = function(socket) {
|
ServerResponse.prototype.detachSocket = function(socket) {
|
||||||
assert(socket._httpMessage == this);
|
assert(socket._httpMessage === this);
|
||||||
socket.removeListener('close', onServerResponseClose);
|
socket.removeListener('close', onServerResponseClose);
|
||||||
socket._httpMessage = null;
|
socket._httpMessage = null;
|
||||||
this.socket = this.connection = null;
|
this.socket = this.connection = null;
|
||||||
@ -467,7 +467,7 @@ function connectionListener(socket) {
|
|||||||
// Usually the first incoming element should be our request. it may
|
// Usually the first incoming element should be our request. it may
|
||||||
// be that in the case abortIncoming() was called that the incoming
|
// be that in the case abortIncoming() was called that the incoming
|
||||||
// array will be empty.
|
// array will be empty.
|
||||||
assert(incoming.length == 0 || incoming[0] === req);
|
assert(incoming.length === 0 || incoming[0] === req);
|
||||||
|
|
||||||
incoming.shift();
|
incoming.shift();
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ Url.prototype.resolveObject = function(relative) {
|
|||||||
var up = 0;
|
var up = 0;
|
||||||
for (var i = srcPath.length; i >= 0; i--) {
|
for (var i = srcPath.length; i >= 0; i--) {
|
||||||
last = srcPath[i];
|
last = srcPath[i];
|
||||||
if (last == '.') {
|
if (last === '.') {
|
||||||
srcPath.splice(i, 1);
|
srcPath.splice(i, 1);
|
||||||
} else if (last === '..') {
|
} else if (last === '..') {
|
||||||
srcPath.splice(i, 1);
|
srcPath.splice(i, 1);
|
||||||
|
@ -338,7 +338,7 @@ function formatValue(ctx, value, recurseTimes) {
|
|||||||
base = ' ' + '[Boolean: ' + formatted + ']';
|
base = ' ' + '[Boolean: ' + formatted + ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keys.length === 0 && (!array || value.length == 0)) {
|
if (keys.length === 0 && (!array || value.length === 0)) {
|
||||||
return braces[0] + base + braces[1];
|
return braces[0] + base + braces[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user