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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and targos committed Dec 2, 2019
1 parent 1222be8 commit 1918b4e
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 @@ -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';
}
Expand Down

0 comments on commit 1918b4e

Please sign in to comment.