2015-09-11 14:04:26 -07:00
|
|
|
'use strict';
|
2016-05-29 03:06:56 -04:00
|
|
|
require('../common');
|
2018-03-22 22:47:39 +05:30
|
|
|
|
|
|
|
// This test ensures Node.js doesn't throw an error when making requests with
|
|
|
|
// the payload 16kb or more in size.
|
|
|
|
// https://github.com/nodejs/node/issues/2821
|
|
|
|
|
2015-09-11 14:04:26 -07:00
|
|
|
const http = require('http');
|
|
|
|
|
|
|
|
const server = http.createServer(function(req, res) {
|
|
|
|
res.writeHead(200);
|
|
|
|
res.end();
|
|
|
|
|
|
|
|
server.close();
|
|
|
|
});
|
|
|
|
|
2016-05-29 03:06:56 -04:00
|
|
|
server.listen(0, function() {
|
2015-09-11 14:04:26 -07:00
|
|
|
const req = http.request({
|
|
|
|
method: 'POST',
|
2016-05-29 03:06:56 -04:00
|
|
|
port: this.address().port
|
2015-09-11 14:04:26 -07:00
|
|
|
});
|
|
|
|
|
2016-01-25 15:00:06 -08:00
|
|
|
const payload = Buffer.alloc(16390, 'Й');
|
2015-09-11 14:04:26 -07:00
|
|
|
req.write(payload);
|
|
|
|
req.end();
|
|
|
|
});
|