-
Notifications
You must be signed in to change notification settings - Fork 368
Configuration: made large_header_buffer_size a valid setting. #771
Conversation
|
I'd like to consider the name of the configurable. I think we can provide a more concise name for users.
I propose |
|
Can do, haven't tried yet, but I think the mapping would happen in the {
nxt_string("max_header_size"),
NXT_CONF_MAP_SIZE,
offsetof(nxt_socket_conf_t, large_header_buffer_size),
},Do we mind that the setting name and the internal structure member name no longer match? or do we want to change that as well? |
I prefer if they match. Do you think reasonable changing the other side as well? |
|
There's less than half a dozen references to |
|
Hi, We need to think about them together, especially for In my feelings, the current way is better than the below one. And now it introduced a new setting to make a single header larger. If users want to make the whole request header be large enough, they still can't do it without changing |
[...]
[...] That makes sense. Thanks @hongzhidao ! |
|
Nice work on this one! |
|
Hi Zhidao, if you review this and use the above 'Compare' button, ignore the changes to the first couple of files, they are from a different commit and not part of this (the result of me fighting with GitHub). Alternatively look at 346a036 |
|
Changes :-
|
btw, if the patch is ready to review, will you post it into RB? |
Sure. I'll stick it before 'body_buffer_size'.
Ah, in src/nxt_router.c, yes good spot.
Hmm, I'll see if I can cook some up.
I'd prefer to keep it on GH, then everyone can follow along. No need to take it private... |
Btw, it's fine to separate tests into an individual commit, both ways are ok. |
|
Changes :-
|
|
Added review requests for @andrey-zelenkov to check over the tests. |
docs/changes.xml
Outdated
| <change type="feature"> | ||
| <para> | ||
| new configuration option 'max_headers_size' for 'settings.http' to set the | ||
| maximum allowed size of the HTTP headers (incl URL). Defaults to 8192 bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/incl URL/including request line would be more accurate I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'technical' term seems to be start-line
|
Changes :-
|
|
@andrey-zelenkov When you get a chance, if you could take a quick look over the tests, they're pretty simple. Cheers. |
9c9445d to
e7bf718
Compare
|
Reverted the first commit back to using 'large_header_buffer_size' as the config option. Added a new commit that adds 'large_header_buffers' as a valid config option. |
|
Changes :-
|
@JanMikes and @tagur87 on GitHub both reported issues with long URLs that were exceeding the 8192 byte large_header_buffer_size setting, which resulted in a HTTP 431 error (Request Header Fields Too Large).
This can be resolved in the code by updating the following line in src/nxt_router.c::nxt_router_conf_create()
However, requiring users to modify unit and install custom versions is less than ideal. We could increase the value, but to what?
This commit takes the option of allowing the user to set this option in their config.
large_header_buffer_size is already set by the configuration system in nxt_router.c it just isn't set as a valid config option in nxt_conf_validation.c
With this change users can set this option in their config if required by the following
It retains its default value of 8192 if this is not set.
With this commit, without the above setting or too low a value, with a long URL you get a 431 error. With the above setting set to a large enough value, the request is successful.
Closes: #521
Signed-off-by: Andrew Clayton a.clayton@nginx.com