From 7b9aece4d25d3b206ebb8bb124dbed9cbe3d5d18 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 10 Dec 2017 12:48:24 +1300 Subject: [PATCH] use pathEscape / pathUnescape for query/rx URLs (fixes + in regex) --- Router.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Router.go b/Router.go index a3065cf..349a3a4 100644 --- a/Router.go +++ b/Router.go @@ -121,7 +121,7 @@ func (this *ArchiveServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } else if matches := this.rxSearch.FindStringSubmatch(r.URL.Path); len(matches) > 0 { if ls := this.lookupSource(matches[1]); ls != nil { arc.selectSource(ls, matches[1]) - arc.query, _ = url.QueryUnescape(matches[2]) + arc.query, _ = url.PathUnescape(matches[2]) arc.queryIsRegex = false arc.renderSearch(w) @@ -132,7 +132,7 @@ func (this *ArchiveServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } else if matches := this.rxSearchRx.FindStringSubmatch(r.URL.Path); len(matches) > 0 { if ls := this.lookupSource(matches[1]); ls != nil { arc.selectSource(ls, matches[1]) - arc.query, _ = url.QueryUnescape(matches[2]) + arc.query, _ = url.PathUnescape(matches[2]) arc.queryIsRegex = true arc.renderSearch(w)