summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-request-large-payload.js
diff options
context:
space:
mode:
authorUjjwal Sharma <usharma1998@gmail.com>2018-03-22 22:47:39 +0530
committerTrivikram <16024985+trivikr@users.noreply.github.com>2018-03-28 16:18:10 -0700
commitff7c2ccf230d0fd43402229da38a238ea1ee039f (patch)
tree77f6a8e5c00b0e73824f64497fd10aada0e518a4 /test/parallel/test-http-request-large-payload.js
parent7e07687230894e2c8d84e91e71251d21609e062e (diff)
downloadandroid-node-v8-ff7c2ccf230d0fd43402229da38a238ea1ee039f.tar.gz
android-node-v8-ff7c2ccf230d0fd43402229da38a238ea1ee039f.tar.bz2
android-node-v8-ff7c2ccf230d0fd43402229da38a238ea1ee039f.zip
test: rename tests with descriptive filenames
Refs: https://github.com/nodejs/node/issues/19105 Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure PR-URL: https://github.com/nodejs/node/pull/19608 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test/parallel/test-http-request-large-payload.js')
-rw-r--r--test/parallel/test-http-request-large-payload.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/parallel/test-http-request-large-payload.js b/test/parallel/test-http-request-large-payload.js
new file mode 100644
index 0000000000..3be100b740
--- /dev/null
+++ b/test/parallel/test-http-request-large-payload.js
@@ -0,0 +1,26 @@
+'use strict';
+require('../common');
+
+// 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
+
+const http = require('http');
+
+const server = http.createServer(function(req, res) {
+ res.writeHead(200);
+ res.end();
+
+ server.close();
+});
+
+server.listen(0, function() {
+ const req = http.request({
+ method: 'POST',
+ port: this.address().port
+ });
+
+ const payload = Buffer.alloc(16390, 'Й');
+ req.write(payload);
+ req.end();
+});