Skip to content

Commit

Permalink
Fix(server): reset maxRequestBodySize to the server's config (#1360)
Browse files Browse the repository at this point in the history
* fix(server): reset maxRequestBodySize to the server's config when HeaderReceived is set

* fix(server): reset writeTimeout
  • Loading branch information
GeraltXLi authored Aug 23, 2022
1 parent af94725 commit 3b147b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
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 3b147b7

Please sign in to comment.