// but *can* have a content-length which actually corresponds
// to the content-length of the entity-body had the request
// been a GET.
- var isHeadResponse = req.method == 'HEAD';
+ var isHeadResponse = req.method === 'HEAD';
debug('AGENT isHeadResponse', isHeadResponse);
- if (res.statusCode == 100) {
+ if (res.statusCode === 100) {
// restart the parser, as this is a continue message.
delete req.res; // Clear res so that we don't hit double-responses.
req.emit('continue');
}
// Date header
- if (this.sendDate == true && state.sentDateHeader == false) {
+ if (this.sendDate === true && state.sentDateHeader === false) {
state.messageHeader += 'Date: ' + utcDate() + CRLF;
}
// of creating security liabilities, so suppress the zero chunk and force
// the connection to close.
var statusCode = this.statusCode;
- if ((statusCode == 204 || statusCode === 304) &&
+ if ((statusCode === 204 || statusCode === 304) &&
this.chunkedEncoding === true) {
debug(statusCode + ' response should not use chunked encoding,' +
' closing connection.');
}
}
- if (state.sentContentLengthHeader == false &&
- state.sentTransferEncodingHeader == false) {
+ if (state.sentContentLengthHeader === false &&
+ state.sentTransferEncodingHeader === false) {
if (this._hasBody && !this._removedHeader['transfer-encoding']) {
if (this.useChunkedEncodingByDefault) {
state.messageHeader += 'Transfer-Encoding: chunked\r\n';
};
ServerResponse.prototype.detachSocket = function(socket) {
- assert(socket._httpMessage == this);
+ assert(socket._httpMessage === this);
socket.removeListener('close', onServerResponseClose);
socket._httpMessage = null;
this.socket = this.connection = null;
// Usually the first incoming element should be our request. it may
// be that in the case abortIncoming() was called that the incoming
// array will be empty.
- assert(incoming.length == 0 || incoming[0] === req);
+ assert(incoming.length === 0 || incoming[0] === req);
incoming.shift();
var up = 0;
for (var i = srcPath.length; i >= 0; i--) {
last = srcPath[i];
- if (last == '.') {
+ if (last === '.') {
srcPath.splice(i, 1);
} else if (last === '..') {
srcPath.splice(i, 1);
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];
}