diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2016-09-26 23:27:17 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2016-09-26 23:27:17 +1000 |
| commit | c173ace2b886801d638f943771ce59df04dfcec2 (patch) | |
| tree | 6bb8f61de5027b8e0a8877ab266d5a094bc4d682 /main.go | |
| parent | Don't include :port if the server is onthe default port 70 (diff) | |
| download | gopherproxy-c173ace2b886801d638f943771ce59df04dfcec2.tar.gz gopherproxy-c173ace2b886801d638f943771ce59df04dfcec2.tar.bz2 gopherproxy-c173ace2b886801d638f943771ce59df04dfcec2.zip | |
Don't encode slashes
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -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 | } |
