From aa9bca810912f102a13a674ee30bf97f5667f662 Mon Sep 17 00:00:00 2001 From: tjp Date: Mon, 13 Nov 2023 07:27:56 -0700 Subject: lint and bug fixes --- spartan/request.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'spartan/request.go') diff --git a/spartan/request.go b/spartan/request.go index d6a06f3..aa696fa 100644 --- a/spartan/request.go +++ b/spartan/request.go @@ -44,18 +44,20 @@ func ParseRequest(rdr io.Reader) (*types.Request, int, error) { return nil, 0, InvalidRequestLine } + u, err := url.Parse(path) + if err != nil { + return nil, 0, err + } + u.Scheme = "spartan" + u.Host = host + contentlen, err := strconv.Atoi(rest) if err != nil { return nil, 0, err } return &types.Request{ - URL: &url.URL{ - Scheme: "spartan", - Host: host, - Path: path, - RawPath: path, - }, + URL: u, Meta: &io.LimitedReader{R: bufrdr, N: int64(contentlen)}, }, contentlen, nil } -- cgit v1.2.3