From 04e07fdc620841068f12b8edf36f27e6592a0a18 Mon Sep 17 00:00:00 2001 From: Vern Brandl Date: Tue, 16 Apr 2019 18:05:18 +0800 Subject: [PATCH] test: Buffer() is deprecated due to security and usability issues. so use the Buffer.alloc() instead (#1321) --- test/response/writable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/response/writable.js b/test/response/writable.js index b3dbf1e..3f5d011 100644 --- a/test/response/writable.js +++ b/test/response/writable.js @@ -9,7 +9,7 @@ describe('res.writable', () => { describe('when continuous requests in one persistent connection', () => { function requestTwice(server, done){ const port = server.address().port; - const buf = new Buffer('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n'); + const buf = Buffer.from('GET / HTTP/1.1\r\nHost: localhost:' + port + '\r\nConnection: keep-alive\r\n\r\n'); const client = net.connect(port); const datas = []; client