diff options
| -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 | } |
