Skip to content

Commit

Permalink
test: correct header length subtraction
Browse files Browse the repository at this point in the history
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: #30712
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott authored and targos committed Dec 5, 2019
1 parent e3c9e08 commit 489d333
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/sequential/test-http-max-http-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,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';
}
Expand Down

0 comments on commit 489d333

Please sign in to comment.