test: replace string concatenation with template

PR-URL: https://github.com/nodejs/node/pull/15915
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Rob Paton 2017-10-06 09:50:07 -07:00 committed by Ruben Bridgewater
parent d4fbffded4
commit 66a990b5ed
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -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('');