test: Buffer() is deprecated due to security and usability issues. so use the Buffer.alloc() instead (#1321)

This commit is contained in:
Vern Brandl 2019-04-16 18:05:18 +08:00 committed by Yiyu He
parent 130e363856
commit 04e07fdc62

View file

@ -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