Skip to content
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

Config max request header size #174

Merged
merged 5 commits into from
May 8, 2024
Merged

Config max request header size #174

merged 5 commits into from
May 8, 2024

Conversation

guscarreon
Copy link
Contributor

Implements #168 by adding a config field to specify the http request max header size in bytes.

config/config.go Show resolved Hide resolved
server/server.go Outdated Show resolved Hide resolved
@bsardo
Copy link
Collaborator

bsardo commented Apr 25, 2024

Looks good. I'm just waiting to see @AlexBVolcy's comments addressed.

config/config.go Outdated
@@ -95,6 +95,7 @@ func setConfigDefaults(v *viper.Viper) {
v.SetDefault("request_limits.max_size_bytes", utils.REQUEST_MAX_SIZE_BYTES)
v.SetDefault("request_limits.max_num_values", utils.REQUEST_MAX_NUM_VALUES)
v.SetDefault("request_limits.max_ttl_seconds", utils.REQUEST_MAX_TTL_SECONDS)
v.SetDefault("request_limits.max_header_size_bytes", 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does 0 = no limit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If zero, the http.Server is created with a the http library's DefaultMaxHeaderBytes constant that equals 1 MB

AlexBVolcy
AlexBVolcy previously approved these changes May 1, 2024
@@ -867,6 +867,18 @@ func TestRequestLimitsValidateAndLog(t *testing.T) {
},
expectFatal: true,
},
{
description: "Negative max_num_values, expect fatal level log and early exit",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: this comment should reference max_header_size_bytes instead of max_num_values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants