The http tests seem especially prone to including unused variables.
This change removes them.
PR-URL: https://github.com/nodejs/node/pull/4422
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
var net = require('net');
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
var childProcess = require('child_process');
var responseClose = false;
server.listen(common.PORT, function() {
- var client = http.get({
+ http.get({
port: common.PORT,
headers: { connection: 'keep-alive' }
});
function doRequest(i) {
- var req = http.get({
+ http.get({
port: common.PORT,
path: '/request' + i
}, function(res) {
const assert = require('assert');
const http = require('http');
const Agent = require('_http_agent').Agent;
-const EventEmitter = require('events').EventEmitter;
const agent = new Agent({
keepAlive: true,
var common = require('../common');
var assert = require('assert');
var http = require('http');
-var net = require('net');
var request = 0;
var response = 0;
'use strict';
var common = require('../common');
var assert = require('assert');
-var fs = require('fs');
var http = require('http');
var body = 'hello world\n';
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
var server = http.createServer(function(req, res) {
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
// see https://github.com/joyent/node/issues/3257
var common = require('../common');
-var assert = require('assert');
var http = require('http');
var server = http.createServer(function(req, res) {
res.end('ok');
this.close();
}).listen(SSLPORT, function() {
- var req = https.get({
+ https.get({
host: 'localhost',
rejectUnauthorized: false,
headers: {
// where the server has ended the socket.
var http = require('http');
-var net = require('net');
var server = http.createServer(function(req, res) {
setImmediate(function() {
res.destroy();
'use strict';
var common = require('../common');
-var assert = require('assert');
var net = require('net');
var http = require('http');
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
var server = http.createServer(function(req, res) {
});
server.listen(common.PORT, function() {
- var req;
for (var i = 0; i < 4; i += 1) {
- req = http.get({ port: common.PORT, path: '/busy/' + i });
+ http.get({ port: common.PORT, path: '/busy/' + i });
}
});
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
http.createServer(function(req, res) {
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
var net = require('net');
res.end();
});
-var connectCount = 0;
var agent = new http.Agent({maxSockets: 1});
var headers = {'connection': 'keep-alive'};
var name = agent.getName({ port: common.PORT });
});
server.listen(common.PORT, '127.0.0.1', function() {
- var req = http.request({
+ http.request({
host: 'localhost',
port: common.PORT,
path: '/',
'use strict';
var common = require('../common');
-var assert = require('assert');
// no warnings should happen!
var trace = console.trace;
// Neither Content-Length nor Connection
socket.end('HTTP/1.1 200 ok\r\n\r\nHello');
}).listen(common.PORT, function() {
- var req = http.get({port: common.PORT}, function(res) {
+ http.get({port: common.PORT}, function(res) {
res.setEncoding('utf8');
res.on('data', function(chunk) {
body += chunk;
'use strict';
const common = require('../common');
-const assert = require('assert');
const http = require('http');
const net = require('net');
var proxy = http.createServer(function(req, res) {
console.error('proxy req headers: ' + JSON.stringify(req.headers));
- var proxy_req = http.get({
+ http.get({
port: BACKEND_PORT,
path: url.parse(req.url).pathname
}, function(proxy_res) {
nlistening++;
if (nlistening < 2) return;
- var client = http.get({
+ http.get({
port: PROXY_PORT,
path: '/test'
}, function(res) {
]);
res.end('x f o o');
}).listen(common.PORT, function() {
- var expectRawHeaders = [
- 'Date',
- 'Tue, 06 Aug 2013 01:31:54 GMT',
- 'Connection',
- 'close',
- 'Transfer-Encoding',
- 'chunked'
- ];
var req = http.request({ port: common.PORT, path: '/' });
req.addTrailers([
['x-bAr', 'yOyOyOy'],
'use strict';
const common = require('../common');
-const assert = require('assert');
const http = require('http');
const server = http.createServer(function(req, res) {
});
server.listen(common.PORT, function() {
- var req = http.get({port: common.PORT}, function(res) {
+ http.get({port: common.PORT}, function(res) {
server.close();
});
});
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
var util = require('util');
var fork = require('child_process').fork;
'use strict';
var common = require('../common');
-var assert = require('assert');
var http = require('http');
'use strict';
var common = require('../common');
var assert = require('assert');
-var fs = require('fs');
var http = require('http');
var status_ok = false; // status code == 200?
var url = require('url');
var fs = require('fs');
-var clientRequest;
// https options
var httpsOptions = {