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 MylesBorins committed Dec 17, 2019
1 parent b37609d commit 0b0cd8d
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 0b0cd8d

Please sign in to comment.