Skip to content
Permalink
Browse files

src: replace anonymous closure functions with arrow functions

  • Loading branch information...
tpanthera committed Nov 17, 2018
1 parent 07b1e64 commit 804dd818b0bf0912df800df71c1c80d4c1023339
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/parallel/test-http-localaddress.js
@@ -28,26 +28,26 @@ if (!common.hasMultiLocalhost())
const http = require('http');
const assert = require('assert');

const server = http.createServer(function(req, res) {
const server = http.createServer((req, res) => {
console.log(`Connect from: ${req.connection.remoteAddress}`);
assert.strictEqual(req.connection.remoteAddress, '127.0.0.2');

req.on('end', function() {
req.on('end', () => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(`You are from: ${req.connection.remoteAddress}`);
});
req.resume();
});

server.listen(0, '127.0.0.1', function() {
server.listen(0, '127.0.0.1', () => {
const options = { host: 'localhost',
port: this.address().port,
path: '/',
method: 'GET',
localAddress: '127.0.0.2' };

const req = http.request(options, function(res) {
res.on('end', function() {
res.on('end', () => {
server.close();
process.exit();
});

0 comments on commit 804dd81

Please sign in to comment.
You can’t perform that action at this time.