diff options
-rw-r--r-- | server.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -122,7 +122,6 @@ func (srv *Server) HandleConn(conn net.Conn) { }() req, err := ParseRequest(conn) - req.Body = io.LimitReader(req.Body, req.Length()) if err != nil { if e, ok := err.(Error); ok { resp, _ := NewResponse(IntentError, nil) @@ -133,6 +132,8 @@ func (srv *Server) HandleConn(conn net.Conn) { panic(err) } + req.Body = io.LimitReader(req.Body, req.Length()) + if srv.Validate { err = req.Validate() if err != nil { |