From 3f1973b621ad10e783955244d0d9f39176feda45 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Mon, 30 Oct 2023 13:10:42 -0600 Subject: set request body in spartan.ParseRequest --- spartan/serve.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'spartan/serve.go') 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) -- cgit v1.2.3