test: remove unused variables form http tests
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>
This commit is contained in:
parent
5d6f558ea6
commit
abe8a344a5
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var net = require('net');
|
var net = require('net');
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var childProcess = require('child_process');
|
var childProcess = require('child_process');
|
||||||
|
@ -14,7 +14,7 @@ var server = http.Server(function(req, res) {
|
|||||||
var responseClose = false;
|
var responseClose = false;
|
||||||
|
|
||||||
server.listen(common.PORT, function() {
|
server.listen(common.PORT, function() {
|
||||||
var client = http.get({
|
http.get({
|
||||||
port: common.PORT,
|
port: common.PORT,
|
||||||
headers: { connection: 'keep-alive' }
|
headers: { connection: 'keep-alive' }
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ server.listen(common.PORT, function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function doRequest(i) {
|
function doRequest(i) {
|
||||||
var req = http.get({
|
http.get({
|
||||||
port: common.PORT,
|
port: common.PORT,
|
||||||
path: '/request' + i
|
path: '/request' + i
|
||||||
}, function(res) {
|
}, function(res) {
|
||||||
|
@ -3,7 +3,6 @@ var common = require('../common');
|
|||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var Agent = require('_http_agent').Agent;
|
var Agent = require('_http_agent').Agent;
|
||||||
var EventEmitter = require('events').EventEmitter;
|
|
||||||
|
|
||||||
var agent = new Agent({
|
var agent = new Agent({
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var net = require('net');
|
|
||||||
|
|
||||||
var request = 0;
|
var request = 0;
|
||||||
var response = 0;
|
var response = 0;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var fs = require('fs');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
var body = 'hello world\n';
|
var body = 'hello world\n';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
var server = http.createServer(function(req, res) {
|
var server = http.createServer(function(req, res) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// see https://github.com/joyent/node/issues/3257
|
// see https://github.com/joyent/node/issues/3257
|
||||||
|
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
var server = http.createServer(function(req, res) {
|
var server = http.createServer(function(req, res) {
|
||||||
|
@ -57,7 +57,7 @@ if (common.hasCrypto) {
|
|||||||
res.end('ok');
|
res.end('ok');
|
||||||
this.close();
|
this.close();
|
||||||
}).listen(SSLPORT, function() {
|
}).listen(SSLPORT, function() {
|
||||||
var req = https.get({
|
https.get({
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -6,7 +6,6 @@ var assert = require('assert');
|
|||||||
// where the server has ended the socket.
|
// where the server has ended the socket.
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var net = require('net');
|
|
||||||
var server = http.createServer(function(req, res) {
|
var server = http.createServer(function(req, res) {
|
||||||
setImmediate(function() {
|
setImmediate(function() {
|
||||||
res.destroy();
|
res.destroy();
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
var net = require('net');
|
var net = require('net');
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
var server = http.createServer(function(req, res) {
|
var server = http.createServer(function(req, res) {
|
||||||
@ -11,9 +10,8 @@ var server = http.createServer(function(req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
server.listen(common.PORT, function() {
|
server.listen(common.PORT, function() {
|
||||||
var req;
|
|
||||||
for (var i = 0; i < 4; i += 1) {
|
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 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
http.createServer(function(req, res) {
|
http.createServer(function(req, res) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var net = require('net');
|
var net = require('net');
|
||||||
|
@ -11,7 +11,6 @@ var server = http.createServer(function(req, res) {
|
|||||||
res.end();
|
res.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
var connectCount = 0;
|
|
||||||
var agent = new http.Agent({maxSockets: 1});
|
var agent = new http.Agent({maxSockets: 1});
|
||||||
var headers = {'connection': 'keep-alive'};
|
var headers = {'connection': 'keep-alive'};
|
||||||
var name = agent.getName({ port: common.PORT });
|
var name = agent.getName({ port: common.PORT });
|
||||||
|
@ -17,7 +17,7 @@ var server = http.createServer(function(req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
server.listen(common.PORT, '127.0.0.1', function() {
|
server.listen(common.PORT, '127.0.0.1', function() {
|
||||||
var req = http.request({
|
http.request({
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
port: common.PORT,
|
port: common.PORT,
|
||||||
path: '/',
|
path: '/',
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
// no warnings should happen!
|
// no warnings should happen!
|
||||||
var trace = console.trace;
|
var trace = console.trace;
|
||||||
|
@ -10,7 +10,7 @@ var server = net.createServer(function(socket) {
|
|||||||
// Neither Content-Length nor Connection
|
// Neither Content-Length nor Connection
|
||||||
socket.end('HTTP/1.1 200 ok\r\n\r\nHello');
|
socket.end('HTTP/1.1 200 ok\r\n\r\nHello');
|
||||||
}).listen(common.PORT, function() {
|
}).listen(common.PORT, function() {
|
||||||
var req = http.get({port: common.PORT}, function(res) {
|
http.get({port: common.PORT}, function(res) {
|
||||||
res.setEncoding('utf8');
|
res.setEncoding('utf8');
|
||||||
res.on('data', function(chunk) {
|
res.on('data', function(chunk) {
|
||||||
body += chunk;
|
body += chunk;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ var backend = http.createServer(function(req, res) {
|
|||||||
|
|
||||||
var proxy = http.createServer(function(req, res) {
|
var proxy = http.createServer(function(req, res) {
|
||||||
console.error('proxy req headers: ' + JSON.stringify(req.headers));
|
console.error('proxy req headers: ' + JSON.stringify(req.headers));
|
||||||
var proxy_req = http.get({
|
http.get({
|
||||||
port: BACKEND_PORT,
|
port: BACKEND_PORT,
|
||||||
path: url.parse(req.url).pathname
|
path: url.parse(req.url).pathname
|
||||||
}, function(proxy_res) {
|
}, function(proxy_res) {
|
||||||
@ -56,7 +56,7 @@ function startReq() {
|
|||||||
nlistening++;
|
nlistening++;
|
||||||
if (nlistening < 2) return;
|
if (nlistening < 2) return;
|
||||||
|
|
||||||
var client = http.get({
|
http.get({
|
||||||
port: PROXY_PORT,
|
port: PROXY_PORT,
|
||||||
path: '/test'
|
path: '/test'
|
||||||
}, function(res) {
|
}, function(res) {
|
||||||
|
@ -54,14 +54,6 @@ http.createServer(function(req, res) {
|
|||||||
]);
|
]);
|
||||||
res.end('x f o o');
|
res.end('x f o o');
|
||||||
}).listen(common.PORT, function() {
|
}).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: '/' });
|
var req = http.request({ port: common.PORT, path: '/' });
|
||||||
req.addTrailers([
|
req.addTrailers([
|
||||||
['x-bAr', 'yOyOyOy'],
|
['x-bAr', 'yOyOyOy'],
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
|
|
||||||
const server = http.createServer(function(req, res) {
|
const server = http.createServer(function(req, res) {
|
||||||
|
@ -18,7 +18,7 @@ var server = http.Server(function(req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
server.listen(common.PORT, function() {
|
server.listen(common.PORT, function() {
|
||||||
var req = http.get({port: common.PORT}, function(res) {
|
http.get({port: common.PORT}, function(res) {
|
||||||
server.close();
|
server.close();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var fork = require('child_process').fork;
|
var fork = require('child_process').fork;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
var common = require('../common');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var fs = require('fs');
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
|
||||||
var status_ok = false; // status code == 200?
|
var status_ok = false; // status code == 200?
|
||||||
|
@ -10,7 +10,6 @@ var https = require('https');
|
|||||||
|
|
||||||
var url = require('url');
|
var url = require('url');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var clientRequest;
|
|
||||||
|
|
||||||
// https options
|
// https options
|
||||||
var httpsOptions = {
|
var httpsOptions = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user