From db99f5876a112c7a8bb78828ac31ba42b047af06 Mon Sep 17 00:00:00 2001 From: James Mills Date: Mon, 26 Sep 2016 22:52:35 +1000 Subject: Fixed URI handling --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 4ab9579..d1557f6 100644 --- a/main.go +++ b/main.go @@ -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("Error:
%s
", err)) + return + } res, err := gopher.Get( fmt.Sprintf( "gopher://%s/%s", hostport, - url.QueryEscape(path), + uri, ), ) if err != nil { -- cgit v1.2.3-54-g00ecf