mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 14:36:56 +00:00

Several changes: * Soft-Deprecate Buffer() constructors * Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` * Add `--zero-fill-buffers` command line option * Add byteOffset and length to `new Buffer(arrayBuffer)` constructor * buffer.fill('') previously had no effect, now zero-fills * Update the docs PR-URL: https://github.com/nodejs/node/pull/4682 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
23 lines
398 B
JavaScript
23 lines
398 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const http = require('http');
|
|
|
|
const server = http.createServer(function(req, res) {
|
|
res.writeHead(200);
|
|
res.end();
|
|
|
|
server.close();
|
|
});
|
|
|
|
server.listen(common.PORT, function() {
|
|
|
|
const req = http.request({
|
|
method: 'POST',
|
|
port: common.PORT
|
|
});
|
|
|
|
const payload = Buffer.alloc(16390, 'Й');
|
|
req.write(payload);
|
|
req.end();
|
|
});
|