From 3b147b7fe4f97f1671c0bbcffbc832666ef41334 Mon Sep 17 00:00:00 2001 From: Geralt X Li <985078803@qq.com> Date: Tue, 23 Aug 2022 22:44:59 +0800 Subject: [PATCH] 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 --- server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server.go b/server.go index f1406fbd57..08dec4e8d3 100644 --- a/server.go +++ b/server.go @@ -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