Fixed URI handling

This commit is contained in:
James Mills 2016-09-26 22:52:35 +10:00
parent fb383bcaec
commit db99f5876a
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
1 changed files with 6 additions and 1 deletions

View File

@ -73,11 +73,16 @@ func proxy(w http.ResponseWriter, req *http.Request) {
return
}
uri, err := url.QueryUnescape(path)
if err != nil {
io.WriteString(w, fmt.Sprintf("<b>Error:</b><pre>%s</pre>", err))
return
}
res, err := gopher.Get(
fmt.Sprintf(
"gopher://%s/%s",
hostport,
url.QueryEscape(path),
uri,
),
)
if err != nil {