Don't encode slashes

This commit is contained in:
James Mills 2016-09-26 23:27:17 +10:00
parent 4c66260eec
commit c173ace2b8
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
1 changed files with 3 additions and 1 deletions

View File

@ -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,
),
)
}