diff options
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 + } +} |