summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-header-overflow.js
diff options
context:
space:
mode:
authorYann Hamon <yann.hamon@contentful.com>2019-03-06 12:07:47 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-09 00:23:48 +0100
commitc957b0517766729f931a1ef7ab134f75d6a01864 (patch)
tree6cfeff5e53b0c292c1906cfd537c45d43aeb6475 /test/parallel/test-http-header-overflow.js
parent914d90835986722fe8e07e7894032ad0ecde13e6 (diff)
downloadandroid-node-v8-c957b0517766729f931a1ef7ab134f75d6a01864.tar.gz
android-node-v8-c957b0517766729f931a1ef7ab134f75d6a01864.tar.bz2
android-node-v8-c957b0517766729f931a1ef7ab134f75d6a01864.zip
http: send connection: close when closing conn
HTTP/1.1 mandates connections which do not support keep-alive and close the connection send the connection: close header, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 This page also provides more information: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection I understand that HTTP/1.1 defaults to keep-alive - and that the Connection: close header is required when closing a connection. This adds the Connection: close header in the 400 and 414 responses sent on client errors. PR-URL: https://github.com/nodejs/node/pull/26467 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-http-header-overflow.js')
-rw-r--r--test/parallel/test-http-header-overflow.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/parallel/test-http-header-overflow.js b/test/parallel/test-http-header-overflow.js
index a9bf5cbfa0..167dada928 100644
--- a/test/parallel/test-http-header-overflow.js
+++ b/test/parallel/test-http-header-overflow.js
@@ -39,7 +39,8 @@ server.listen(0, mustCall(() => {
c.on('end', mustCall(() => {
assert.strictEqual(
received,
- 'HTTP/1.1 431 Request Header Fields Too Large\r\n\r\n'
+ 'HTTP/1.1 431 Request Header Fields Too Large\r\n' +
+ 'Connection: close\r\n\r\n'
);
c.end();
}));