summaryrefslogtreecommitdiffstats
path: root/server.go
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2017-09-01 16:11:42 +0200
committerclsr <clsr@clsr.net>2017-09-01 16:11:42 +0200
commit7e1f90f27d876db67158ca4787420ec30c18f86b (patch)
tree4526e5924c926af4814968a49c2dd7875fdf0dd0 /server.go
parentee431f1e85a8ee7d3c6e069c8858c671da1c2acd (diff)
downloadcnp-go-7e1f90f27d876db67158ca4787420ec30c18f86b.tar.gz
cnp-go-7e1f90f27d876db67158ca4787420ec30c18f86b.zip
Distinguish between response length=0 and no length parameter
Response.Length returns -1 when the parameter is not present and 0 when it's set to 0. Response.SetLength will only unset the parameter when given -1.
Diffstat (limited to 'server.go')
-rw-r--r--server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.go b/server.go
index 26301ab..c8491fc 100644
--- a/server.go
+++ b/server.go
@@ -139,7 +139,7 @@ func (srv *Server) HandleConn(conn net.Conn) {
req.Body = io.LimitReader(req.Body, req.Length())
if srv.Validate {
- if err != nil {
+ if err := req.Validate(); err != nil {
panic(err)
}
}