Skip to content

Commit

Permalink
Fix(server): reset maxRequestBodySize to the server's config (valyala…
Browse files Browse the repository at this point in the history
…#1360)

* fix(server): reset maxRequestBodySize to the server's config when HeaderReceived is set

* fix(server): reset writeTimeout
  • Loading branch information
GeraltXLi authored and bbenzikry committed Sep 11, 2022
1 parent 68cad8e commit 0dc05f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server.go
Expand Up @@ -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
Expand Down

0 comments on commit 0dc05f8

Please sign in to comment.