diff options
author | Geralt X Li <985078803@qq.com> | 2022-08-23 22:44:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 16:44:59 +0200 |
commit | 3b147b7fe4f97f1671c0bbcffbc832666ef41334 (patch) | |
tree | 85b039131de86c3e849c13c035575d7c8efee2a1 /server.go | |
parent | Reduce slice growth in adaptor (#1356) (diff) | |
download | fasthttp-3b147b7fe4f97f1671c0bbcffbc832666ef41334.tar.gz fasthttp-3b147b7fe4f97f1671c0bbcffbc832666ef41334.tar.bz2 fasthttp-3b147b7fe4f97f1671c0bbcffbc832666ef41334.zip |
Fix(server): reset maxRequestBodySize to the server's config (#1360)
* fix(server): reset maxRequestBodySize to the server's config when HeaderReceived is set
* fix(server): reset writeTimeout
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2194,9 +2194,15 @@ func (s *Server) serveConn(c net.Conn) (err error) { } if reqConf.MaxRequestBodySize > 0 { maxRequestBodySize = reqConf.MaxRequestBodySize + } else if s.MaxRequestBodySize > 0 { + maxRequestBodySize = s.MaxRequestBodySize + } else { + maxRequestBodySize = DefaultMaxRequestBodySize } if reqConf.WriteTimeout > 0 { writeTimeout = reqConf.WriteTimeout + } else { + writeTimeout = s.WriteTimeout } } // read body |