diff --git a/internal/conf/conf.go b/internal/conf/conf.go index a7599419aac..7fc83bf58ed 100644 --- a/internal/conf/conf.go +++ b/internal/conf/conf.go @@ -495,6 +495,12 @@ func (conf Conf) Clone() *Conf { func (conf *Conf) Validate() error { // General + if conf.ReadTimeout <= 0 { + return fmt.Errorf("'readTimeout' must be greater than zero") + } + if conf.WriteTimeout <= 0 { + return fmt.Errorf("'writeTimeout' must be greater than zero") + } if conf.ReadBufferCount != nil { conf.WriteQueueSize = *conf.ReadBufferCount } @@ -506,6 +512,7 @@ func (conf *Conf) Validate() error { } // Authentication + if conf.ExternalAuthenticationURL != nil { conf.AuthMethod = AuthMethodHTTP conf.AuthHTTPAddress = *conf.ExternalAuthenticationURL @@ -658,6 +665,7 @@ func (conf *Conf) Validate() error { } // Record (deprecated) + if conf.Record != nil { conf.PathDefaults.Record = *conf.Record } diff --git a/internal/conf/conf_test.go b/internal/conf/conf_test.go index 4bb3fe678c8..5d81674c26d 100644 --- a/internal/conf/conf_test.go +++ b/internal/conf/conf_test.go @@ -270,6 +270,16 @@ func TestConfErrors(t *testing.T) { `invalid: param`, "json: unknown field \"invalid\"", }, + { + "invalid readTimeout", + "readTimeout: 0s\n", + "'readTimeout' must be greater than zero", + }, + { + "invalid writeTimeout", + "writeTimeout: 0s\n", + "'writeTimeout' must be greater than zero", + }, { "invalid writeQueueSize", "writeQueueSize: 1001\n",