Commit 5aa83fa3 authored by Elvis Pranskevichus's avatar Elvis Pranskevichus

Merge branch 'arusakov-nodejs_server_update'

parents 29a5c941 8403a2d8
...@@ -10,10 +10,13 @@ function handle(request, response) { ...@@ -10,10 +10,13 @@ function handle(request, response) {
if (!msize) { if (!msize) {
msize = 1024; msize = 1024;
} else { } else {
msize = parseInt(msize); msize = parseInt(msize, 10);
} }
if (!responses[msize]) { if (!responses[msize]) {
responses[msize] = Array(msize).join("X"); // for Node.js v4
responses[msize] = new Buffer(msize).fill("X");
// for Node.js v6
// responses[msize] = Buffer.alloc(msize, "X");
} }
response.end(responses[msize]); response.end(responses[msize]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment