From c42c521c74da84a46609b8afb5adee2c623dbacd Mon Sep 17 00:00:00 2001 From: tjp Date: Tue, 14 Nov 2023 21:51:28 -0700 Subject: fix for double-encoded nex request paths --- nex/request.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'nex/request.go') diff --git a/nex/request.go b/nex/request.go index 290d55d..1209c65 100644 --- a/nex/request.go +++ b/nex/request.go @@ -18,11 +18,10 @@ func ParseRequest(rdr io.Reader) (*types.Request, error) { line = strings.TrimSuffix(line, "\n") line = strings.TrimSuffix(line, "\r") - return &types.Request{ - URL: &url.URL{ - Scheme: "nex", - Path: line, - OmitHost: true, - }, - }, nil + u, err := url.Parse("nex:" + line) + if err != nil { + return nil, err + } + u.OmitHost = true + return &types.Request{URL: u}, nil } -- cgit v1.2.3