diff options
author | tjp <tjp@ctrl-c.club> | 2023-11-14 21:51:28 -0700 |
---|---|---|
committer | tjp <tjp@ctrl-c.club> | 2023-11-14 21:51:28 -0700 |
commit | c42c521c74da84a46609b8afb5adee2c623dbacd (patch) | |
tree | fcd699261e6df278e5e24d72b48249a455f34f58 /nex | |
parent | c22799fa12c99932fc4620fce2dc0994567a52af (diff) |
fix for double-encoded nex request pathsv1.6.1
Diffstat (limited to 'nex')
-rw-r--r-- | nex/request.go | 13 |
1 files changed, 6 insertions, 7 deletions
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 } |