aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Mills <prologic@shortcircuit.net.au>2016-09-26 23:27:17 +1000
committerJames Mills <prologic@shortcircuit.net.au>2016-09-26 23:27:17 +1000
commitc173ace2b886801d638f943771ce59df04dfcec2 (patch)
tree6bb8f61de5027b8e0a8877ab266d5a094bc4d682
parentDon't include :port if the server is onthe default port 70 (diff)
downloadgopherproxy-c173ace2b886801d638f943771ce59df04dfcec2.tar.gz
gopherproxy-c173ace2b886801d638f943771ce59df04dfcec2.tar.bz2
gopherproxy-c173ace2b886801d638f943771ce59df04dfcec2.zip
Don't encode slashes
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
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
50 } else { 50 } else {
51 hostport = fmt.Sprintf("%s:%d", x.Host, x.Port) 51 hostport = fmt.Sprintf("%s:%d", x.Host, x.Port)
52 } 52 }
53 path := url.QueryEscape(x.Selector)
54 path = strings.Replace(path, "%2F", "/", -1)
53 tr.Link = template.URL( 55 tr.Link = template.URL(
54 fmt.Sprintf( 56 fmt.Sprintf(
55 "/%s/%s%s", 57 "/%s/%s%s",
56 hostport, 58 hostport,
57 string(byte(x.Type)), 59 string(byte(x.Type)),
58 url.QueryEscape(x.Selector), 60 path,
59 ), 61 ),
60 ) 62 )
61 } 63 }