summaryrefslogtreecommitdiff
path: root/nex
diff options
context:
space:
mode:
Diffstat (limited to 'nex')
-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
}