From 270da6de6e2bf1e48a006baea0dc0e93ac74f72d Mon Sep 17 00:00:00 2001 From: Rob Paton Date: Fri, 6 Oct 2017 09:50:07 -0700 Subject: [PATCH] test: replace string concatenation in test-http-incoming-pipelined-socket-destroy This was a task from Code & Learn at NINA17. --- test/parallel/test-http-incoming-pipelined-socket-destroy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-http-incoming-pipelined-socket-destroy.js b/test/parallel/test-http-incoming-pipelined-socket-destroy.js index b9603a5791690c..7c15339785137b 100644 --- a/test/parallel/test-http-incoming-pipelined-socket-destroy.js +++ b/test/parallel/test-http-incoming-pipelined-socket-destroy.js @@ -60,9 +60,10 @@ const server = http.createServer(common.mustCall(function(req, res) { // Make a bunch of requests pipelined on the same socket function generator(seeds) { + const port = server.address().port; return seeds.map(function(r) { - return 'GET /' + r + ' HTTP/1.1\r\n' + - `Host: localhost:${server.address().port}\r\n` + + return `GET /${r} HTTP/1.1\r\n` + + `Host: localhost:${port}\r\n` + '\r\n' + '\r\n'; }).join('');