diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-10-30 13:10:42 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-10-30 13:10:42 -0600 |
commit | 3f1973b621ad10e783955244d0d9f39176feda45 (patch) | |
tree | 85ef65aa41db4ff6d5ca6585d8147f9e44796047 /spartan/serve.go | |
parent | 87189fafa7134f70dcdd51f1d508686573a91979 (diff) |
set request body in spartan.ParseRequest
Diffstat (limited to 'spartan/serve.go')
-rw-r--r-- | spartan/serve.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/spartan/serve.go b/spartan/serve.go index 0fb4939..f2155ec 100644 --- a/spartan/serve.go +++ b/spartan/serve.go @@ -47,19 +47,13 @@ func (ss *spartanServer) handleConn(conn net.Conn) { buf := bufio.NewReader(conn) var response *types.Response - request, clen, err := ParseRequest(buf) + request, _, err := ParseRequest(buf) if err != nil { response = ClientError(err) } else { request.Server = ss request.RemoteAddr = conn.RemoteAddr() - var body io.Reader = nil - if clen > 0 { - body = io.LimitReader(buf, int64(clen)) - } - request.Meta = body - defer func() { if r := recover(); r != nil { err := fmt.Errorf("%s", r) |