From 5f2a1b528d8fe8e9437d0447a6773c0a73369522 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 10 Dec 2017 13:37:22 +1300 Subject: [PATCH] fix spaces in searches turning into plusses --- Router.go | 4 ++-- util.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Router.go b/Router.go index 349a3a4..67fc09e 100644 --- a/Router.go +++ b/Router.go @@ -157,9 +157,9 @@ func (this *ArchiveServer) legacyRoute(w http.ResponseWriter, r *http.Request) { if u.hasGet("q") { if u.hasGet("rx") { - u.redirectf(`/%d/rx/%s`, hubid, url.QueryEscape(u.get("q"))) + u.redirectf(`/%d/rx/%s`, hubid, url.PathEscape(u.get("q"))) } else { - u.redirectf(`/%d/search/%s`, hubid, url.QueryEscape(u.get("q"))) + u.redirectf(`/%d/search/%s`, hubid, url.PathEscape(u.get("q"))) } } else if u.hasGet("y") && u.hasGet("m") { diff --git a/util.go b/util.go index 715fe84..6a35ba0 100644 --- a/util.go +++ b/util.go @@ -25,7 +25,7 @@ func (this *URLHelper) intval(sz string) int { } func (this *URLHelper) get(sz string) string { - return this.r.URL.Query().Get(sz) + return this.r.URL.Query().Get(sz) // n.b. automatically unescaped } func (this *URLHelper) hasGet(sz string) bool {