test: correct header length subtraction

In test-http-max-http-headers, a comment asks why we are subtracting 32
from the length of the invalid-length-by-1 headers instead of just 1.
Subtracting 1 seems to be correct and works.

PR-URL: https://github.com/nodejs/node/pull/30712
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Rich Trott authored and Michaël Zasso committed 2019-12-02 11:11:27 +01:00
1 parent 1222be81e3
commit 1918b4e84f
1 file changed
+1 -2
@@ -37,8 +37,7 @@ function fillHeaders(headers, currentSize, valid = false) {
// Generate valid headers
if (valid) {
// TODO(mcollina): understand why -32 is needed instead of -1
headers = headers.slice(0, -32);
headers = headers.slice(0, -1);
}
return headers + '\r\n\r\n';
}