summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortjp <tjp@ctrl-c.club>2023-11-14 21:51:28 -0700
committertjp <tjp@ctrl-c.club>2023-11-14 21:51:28 -0700
commitc42c521c74da84a46609b8afb5adee2c623dbacd (patch)
treefcd699261e6df278e5e24d72b48249a455f34f58
parentc22799fa12c99932fc4620fce2dc0994567a52af (diff)
fix for double-encoded nex request pathsv1.6.1
-rw-r--r--nex/request.go13
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
}