From c173ace2b886801d638f943771ce59df04dfcec2 Mon Sep 17 00:00:00 2001 From: James Mills Date: Mon, 26 Sep 2016 23:27:17 +1000 Subject: Don't encode slashes --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 913b0a2..1da5f8e 100644 --- a/main.go +++ b/main.go @@ -50,12 +50,14 @@ func renderDirectory(w http.ResponseWriter, tpl *template.Template, hostport str } else { hostport = fmt.Sprintf("%s:%d", x.Host, x.Port) } + path := url.QueryEscape(x.Selector) + path = strings.Replace(path, "%2F", "/", -1) tr.Link = template.URL( fmt.Sprintf( "/%s/%s%s", hostport, string(byte(x.Type)), - url.QueryEscape(x.Selector), + path, ), ) } -- cgit v1.2.3-54-g00ecf