-
Notifications
You must be signed in to change notification settings - Fork 60
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
Conversation
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) |
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.
Does 0 = no limit?
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.
If zero, the http.Server
is created with a the http
library's DefaultMaxHeaderBytes
constant that equals 1 MB
config/config_test.go
Outdated
@@ -867,6 +867,18 @@ func TestRequestLimitsValidateAndLog(t *testing.T) { | |||
}, | |||
expectFatal: true, | |||
}, | |||
{ | |||
description: "Negative max_num_values, expect fatal level log and early exit", |
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.
Nitpick: this comment should reference max_header_size_bytes
instead of max_num_values
.
Implements #168 by adding a config field to specify the http request max header size in bytes.