summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gopher/request.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/gopher/request.go b/gopher/request.go
index 4125af3..0757654 100644
--- a/gopher/request.go
+++ b/gopher/request.go
@@ -25,10 +25,10 @@ func ParseRequest(rdr io.Reader) (*sr.Request, error) {
return &sr.Request{
URL: &url.URL{
Scheme: "gopher",
- Path: path.Clean(strings.TrimSuffix(selector, "\r\n")),
+ Path: path.Clean(selector),
OmitHost: true, //nolint:typecheck
// (for some reason typecheck on drone-ci doesn't realize OmitHost is a field in url.URL)
- RawQuery: url.QueryEscape(strings.TrimSuffix(search, "\r\n")),
+ RawQuery: url.QueryEscape(search),
},
}, nil
}
@@ -68,5 +68,5 @@ func readFullRequest(rdr io.Reader) (string, string, error) {
}
selector, search, _ := bytes.Cut(buf, []byte{'\t'})
- return string(selector), string(search), nil
+ return strings.TrimRight(string(selector), "\r\n"), strings.TrimRight(string(search), "\r\n"), nil
}