diff options
author | valentin v / vvval <[email protected]> | 2019-02-21 15:17:40 +0300 |
---|---|---|
committer | valentin v / vvval <[email protected]> | 2019-02-21 15:17:40 +0300 |
commit | 46a52a8691e83c81a6d12183eddf188b5d15f011 (patch) | |
tree | 5aa06af7b90be39f72559eb8500c591d2bc411c9 /service/http/config.go | |
parent | 3c1923606c7b5391678b7a760772c8e55f046025 (diff) |
Rename MaxRequest config param
Added MaxRequestSize param, previous one is marked as deprecated,
now they are merged
Diffstat (limited to 'service/http/config.go')
-rw-r--r-- | service/http/config.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/service/http/config.go b/service/http/config.go index 5a2c8768..711939b7 100644 --- a/service/http/config.go +++ b/service/http/config.go @@ -17,8 +17,9 @@ type Config struct { // SSL defines https server options. SSL SSLConfig - // MaxRequest specified max size for payload body in megabytes, set 0 to unlimited. - MaxRequest int64 + // MaxRequestSize specified max size for payload body in megabytes, set 0 to unlimited. + MaxRequest int64 + MaxRequestSize int64 // Uploads configures uploads configuration. Uploads *UploadsConfig @@ -68,6 +69,7 @@ func (c *Config) Hydrate(cfg service.Config) error { return err } + c.mergeBackwardCompatibility() c.Workers.UpscaleDurations() return c.Valid() @@ -115,3 +117,9 @@ func (c *Config) Valid() error { return nil } + +func (c *Config) mergeBackwardCompatibility() { + if c.MaxRequestSize == 0 && c.MaxRequest != 0 { + c.MaxRequestSize = c.MaxRequest + } +} |