Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
http: fix the comment to reflect the actual currentSize composition
  • Loading branch information
caiolrm committed Mar 10, 2019
commit 93e384a75bd5ff8b528437e9c8a937575d27bb59
2 changes: 1 addition & 1 deletion test/sequential/test-http-max-http-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const test2 = common.mustCall(() => {
'Agent: nod2\r\n' +
'X-CRASH: ';

// /, Host, localhost, Agent, node, X-CRASH, a...
// Host, localhost, Agent, node, X-CRASH, a...
const currentSize = 4 + 9 + 5 + 4 + 7;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain this change?

Copy link
Copy Markdown
Author

@caiolrm caiolrm Mar 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentSize is being used by fillHeaders to subtract from the max header size and generate a header value with a length that makes the total header size hit the limit. Since the implementation at node_http_parser_impl.h when using llhttp doesn't count the url size towards the header size after the changes, there's no point considering the "/" size when using fillHeaders anymore.

headers = fillHeaders(headers, currentSize);

Expand Down