-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: make HTTP_MAX_HEADER_SIZE configurable #24716
build: make HTTP_MAX_HEADER_SIZE configurable #24716
Conversation
cc @nodejs/lts this will need to be backported on all lines. Sorry about not adding this in the security release. |
cc @ofrobots @zauberpony this should solve your need. @indutny @rvagg I'm not 100% sure how to pass this down to llhttp. Can you please chime in? I couldn't find where HTTP_MAX_HEADER_SIZE is used in llhttp or if it's another define. |
|
Needs to also modify doc/api/errors.md, probably can't say what the limit is, but can mention that it may be other than the default in a custom node build. The limit could be surfaced through C++, into js as a constant. Isn't there a place already for configure-time constants? @jasnell ? |
#ifdef HTTP_MAX_HEADER_SIZE
static const uint64_t kMaxHeaderSize = HTTP_MAX_HEADER_SIZE;
#else
static const uint64_t kMaxHeaderSize = 8 * 1024;
#endif // HTTP_MAX_HEADER_SIZE Or do we just ditch When we ditch http_parser we could make this configurable from a runtime API, so maybe retaining it will point us in that direction? We could even do it now for when compiled with llhttp I guess. |
@rvagg can you please clarify if I should pass down that definition to our
I think this a very good reason to switch to the new http parser for 12. |
The maximum size of headers introduced in the security release of 2018/11/27 is not configurable. This change adds a --http-max-header-size option to ./configure. See: nodejs#24693
I think we should do so, as changing the value at configure time would make our tests fails with the new configuration. How about |
c2716d1
to
793286c
Compare
793286c
to
c0293de
Compare
CI: https://ci.nodejs.org/job/node-test-pull-request/19154/ @bnoordhuis @nodejs/build may I get a couple of LGTMs? |
Changes look okay to me, but if we're going to land a runtime configuration option (#24811) I would rather not add more build time configuration options. |
@richardlau I think both are valid. One sets the default, and the other one changes it at runtime. @cjihrig what do you think? |
IMO, having a runtime option is desirable because it lets people who are impacted by our recent change continue to run an official build (and not have to build Node themselves). I'm not opposed to also having a build time setting though. |
I agree. |
Was this superseded by #24811? |
Not really, but there is no urgency to get it landed, and I have other prioritites atm. So, we can close. |
Should this be ported to v8.x? |
The maximum size of headers introduced in the security release of
2018/11/27 is not configurable. This change adds a
--http-max-header-size option to ./configure.
See: #24693
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes