summaryrefslogtreecommitdiffstats
path: root/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server.go')
-rw-r--r--server.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.go b/server.go
index 3413923..4320f41 100644
--- a/server.go
+++ b/server.go
@@ -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 {